boot process recovery or rom When I power my device (htc one m8) on and press the volume down key I get into recovery.

Now which part of the booting process checks if this key is pressed and uses the correct partiton (boot or recovery).

Is this the bootloader?

If yes, is this the 'same' bootloader as formerly found in the aosp tree?
The initial input is read by the bootloader to see which partition to boot. Vol- will trigger bootloader, while no input will trigger ROM partition. The bootloader is initially installed by your OEM. No matter what version of Android you have, you still have the same bootloader until you either update your bootloader or install a custom bootloader. The OEM bootloaders are likely based off the AOSP tree, depending on your specific phone (I am not sure for the M8).