As I recollect...the very first thing is a part of the CPU will wake up, fetch BIOS code and begin executing instructions to finish initializing itself and RAM and to find and access system drives. Then it should be able to find and fetch UEFI from the UEFI partition which has the VGA driver to output graphics mode to the GPU and monitor, that's when you get the pretty logos during the rest of POST. Once it finishes POST it transfer control to the OS (bootloader for Windows, I think it's called Grub or maybe Grub2 for most Linux distros) to finish starting up the OS, which has it's own order based on various things and can be specific to each installation.
If UEFI isn't installed it uses compatibility mode which outputs text mode to the monitor instead until it transfers control to OS which had best be located in a specific sector of the drive indicated in CMOS settings. It will execute any code it finds there and do whatever it says...even if to simply tell you to call a number if you want to get access to your data.