Apps Callbackmethods of des Activity Life Cycle and the UI-Thread




I'm struggling with the Life Cycle of activities. Ok, with the help of the callback methods onCreate(), on Start(), onResume(), onPause(),..., onDestroy() you are able to react to state changes in your activity by overwriting them. Well, as far as I understand this issue, those methods are called by the UI thread of the application (also calles main thread) in which the activity is running. Is that right?

But who advises the UI thread when to call those callback methods? Or does he manage them on his own? I think the OS has to catch the events caused by the user oder arised in the sytem that lead to a state change of my activity. And then it has to convey them in any kind to the UI thread. Or?
E.g. pushing the home button while the activity is in the state runnning/active causes the call of onPause() and then onStop(). Is there something like a Message or a Runnable object that is put into the MessageQueue of the UI thread? Or how does the notification mechanism look like?
Could somebody explain how this works?

Thanks for your help