It fires these lasers at a wall, which bounces them into a room. The beams then reflect off objects and people before re-emerging and striking a detector. The detector takes measurements every few picoseconds, or trillionths of a second.
The camera does this several times, bouncing light off several different spots on the wall to cover several angles.
The system then compares the time at which each light beam returns to the detector (and their angle), to piece together a picture of the room’s geometry. It’s a bit like ultrasound, or the way Microsoft’s Kinect uses a bunch of infrared dots to determine 3D shapes.