The Universal Serial Bus is a computer bus used by a CPU and its peripherals to communicate with each other. In every USB communication, at least one USB host and one USB device exists. The former is the one that effectively directs the traffic flow to the devices, while the latter is the one that simply answers all the host's requests.
Practically, the USB host periodically queries all the connected USB devices in order to discover whether they want to send a message to it.
So, the host is smart enough to understand what kind of peripheral the user has connected to, and it can reconfigure the system in order to correctly manage it. This magic happens each time a USB device is first connected to a USB host, thanks to the enumeration process.
The enumeration starts by sending a reset signal to the USB device (at this stage, the data rate of the USB device is also automatically determined), and after the reset, all the information of the USB device is read by...