The "board selector" menu on the Arduino IDE toolbar is a list of the "ports" discovered by the IDE. A board model may be associated with a port, and when there is such an association, the board model is selected in addition to the port when the user selects an item from the "board selector".
When Arduino IDE discovers a port, it checks to see if a board definition in any of the installed platforms has specified an association with the properties of that port. If so, it will use that board model for the board selected menu item for the port. In this case, selecting that menu item is functionally identical to selecting the board model from the Tools > Board menu and the port from the Tools > Port menu.
If Arduino IDE does not find an associated board definition for a port, it makes a request to the get /v3/boards/byVidPid/{vid}/{pid} endpoint of the "Arduino Builder API":
https://builder.arduino.cc/docs#!/boards95v3/boards_v3_byVidPid
For example, if the port was produced by an UNO R4 WiFi board, it will make this request:
https://builder.arduino.cc/v3/boards/byVidPid/0x2341/0x1002
(2341:1002 is the VID/PID pair of the UNO R4 WiFi)
which returns this response:
{
"architecture": "renesas_uno",
"fqbn": "arduino:renesas_uno:unor4wifi",
"href": "/v3/boards/arduino:renesas_uno:unor4wifi",
"id": "unor4wifi",
"name": "Arduino UNO R4 WiFi",
"package": "arduino",
"plan": "create-free"
}
From this information, Arduino IDE is able to identify the port as an UNO R4 WiFi board.
The reason for doing this is so that Arduino IDE can automatically offer the installation of the required platform:
So in order to get set up to use a new board, the user only needs to connect the board to their computer, select the item for that board from the prominent menu on the Arduino IDE toolbar, and then click the "YES" button on the friendly notification that appears.