Why is only UI thread allowed to modify the UI


After working in various frameworks such as Win32 API, WPF, Silverlight, Android and iOS over the years, one theme which has been common throughout all these frameworks is the restriction to modify the UI only through UI thread.

There are various ways in these frameworks to modify the UI through a thread other than UI thread. Some of them are captured in the articles below:

Why is such a restriction in place ? Some of these links provide insight: