NOTE: This page is a recollection of what I've written previously. I do not guarantee it's accuracy.
GIO’s GApplication is basically a wrapper around GLib’s mainloop that adds process deduplication, commandline argument parsing (which it might just hand off to a virtual method), a DBus server, etc.
GLib’s mainloop in turn wraps the poll() syscall, or an appropriate wrapper around select() or the corresponding Windows APIs, with a near-infinite loop and a linked list of “sources” that translates to poll()’s arguments and dispatches the results.