I thought it was an implementation of the Win32 API as a compatibility layer.

What is it emulating exactly?

DOS interrupts, for starters.