The GND of slot on micro:bit is into innards of batteries’ GND to generate current loop.
When the button pressed, the circuit connects, P2 port of the micro:bit connects GND and level of P2 be pulled down.
This is a common component used to control electronic devices. It is used to connect or cut electrical circuits. This momentary push button switch is usually open. When it’s pressed down, it completes the circuit and turns the device on. When it’s released, it bounces back to the original state of disconnect.
There is a button with blue hat on the experiment box.