Here’s an app note from ST discussing how the bootloader works and how it’s activated –the general concept of the bootloader (PDF!):
The bootloader is stored in the internal boot ROM memory (system memory) of STM32
devices. It is programmed by ST during production. Its main task is to download the
application program to the internal Flash memory through one of the available serial
peripherals (USART, CAN, USB, I2C, SPI, etc.). A communication protocol is defined for
each serial interface, with a compatible command set and sequences.
This document applies to the products listed in Table 1. They are referred as STM32
throughout the document.