My question is how does the motion work exactly
Passive infrared means it doesn’t generate or radiate any energy.
They work entirely by detecting the energy given off by other objects. PIR sensors don’t detect or measure “heat”; instead they detect the infrared radiation emitted or reflected from an object.
Look at it like the sensor is developing a snapshot image of infrared light pattern in its field of view when you arm it, converted then into voltage. It takes a few minutes to do this. Afterwards, if that “snapshot” voltage should deviate beyond a set parameter, it activates.
That’s why they should not be facing windows/doors, or be in the path of heating vents or near bathrooms, or were there are large or fast moving pets (I.e., pet immune PIRs). The shifting sunlight, or ventilation heat, or steam, or even a small animal moving fast can change the emitted/reflected radiation of the objects that the PIR lenses sees too fast, and it will trigger.
When an object, such as a human, passes in front of the background, such as a wall, the temperature at that point in the sensor’s field of view will rise from room temperature to body temperature, and then back again. The sensor converts the resulting change in the incoming infrared radiation into a change in the output voltage, and this triggers the detection opening the sensor circuit (which is normally closed), triggering panel alarm.