The motherboard contains firmware that runs bootloaders that boot OSes, and the two main types of such firmware are UEFI (new) and BIOS (old). In both cases, there’s a small amount of non-volatile storage on the motherboard which records the user’s preference as to which bootloader to use. It’s also often possible to press a certain button during boot to override this preference for this particular boot.
BIOS simply records an order of physical drives (plus generic entries such as “USB drives” which may be tried, if present, before other things, or after, or never), and booting involves loading the MBR of the first drive (the first 512 bytes) into memory and running the code it contains. If that fails, BIOS tries the next drive. 512 bytes isn’t much, so the typical BIOS bootloader installation process stores the bootloader somewhere else, notes its location on the drive and puts a small piece of code into the MBR that merely runs the actual bootloader.
UEFI, unlike BIOS, has the capability of reading files from FAT32 partitions. There has to be a partition marked with a certain GPT code, and UEFI settings include a list of paths to files found therein. UEFI will find that partition, load the file that’s the first in the list into memory and execute the code it contains. Later, having booted an OS, it’s possible to modify UEFI settings from within the OS, something that typically isn’t possible with BIOS.
In either case, a bootloader such as GRUB is started, and it can be quite a sophisticated program, containing its own hardware and filesystem drivers so it can read files from partitions, even encrypted ones. Typically, it reads its own configuration from a file in a predefined place on a predefined partition, which contains a list of OSes and parameters to be passed to those, and displays a menu to the user. Once the choice is made, it reads the file containing the OS kernel, puts it into memory according to the requirements of that OS and launches it. From that point on, the kernel is in control.
Some OSes, such as Linux, have their kernel file laid out in a certain way compatible with UEFI requirements, so they can be booted from UEFI directly without the use of a bootloader, but this approach is uncommon.
The bootable flag comes from the times when bootloaders were typically put in volume boot records at the start of a partition (as opposed to the start of the entire drive), and the MBR code would enumerate the partitions and chainload the bootloader from the one marked bootable. The flag is irrelevant with modern bootloaders.
So the user can choose which OS to boot both by means of UEFI or BIOS and by means of the bootloader, in practice it’s almost always the latter (UEFI/BIOS load the same bootloader each time which then displays a pretty menu and boots the chosen OS).