There are two common types of motion sensors – passive infrared (PIR) and Ultrasonic. The most common type is PIR which sees IR which is emitted by hot objects. There is a special lens in front of the sensor so a warm object moving through its field of view creates sudden transitions that are easy to detect. Since it is relying on heat emissions it works fine with or without light.
Ultrasonics send out a sonar burst and effectively echo locate like a bat. They check the sound they get back after each one and compare it to the last one, if it changed significantly then something in the space moved and they trigger.