GUIObject.Button: how does it work?


I was wondering how if(GUILayout.Button(..)) actually works internally.

It is a weird construction, since it returns "true" when the user presses the button, but on the other hand, it also creates a button and then just jumps to the next block of code, so this statement doesn’t actually block execution. Then again, it’s not of a known asynchronous model.
How is this wired internally?