In some frameworks there's a dedicated thread that exclusively manages all UI objects. It's the developer's responsibility to use this thread for UI updates (e.g. adding, updating and removing controls).
In some frameworks (.Net, Android, iOS, Java Swing etc.) there's a dedicated thread that exclusivly creates and manages all the UI objects. Only this thread is allowed to modify UI objects (add, remove, set text on the button, etc). Other threads usually just post a request to make such modifications.
UI thread must never be paused for long with slow task (like communication over network or something computation intensive) as this would make all GUI non-responsive.