Both Windows (Win32 API) and OS X (Cocoa) have their own APIs to handle windows, events and other OS stuff. I have never really got a clear answer as to what Linux’s equival
As you might hear, wayland is the featured choice of many distros these days, because of its protocol is simpler than the X.
Toolkits or gui libraries that wayland suggests are: