Original: It uses a combination of built-in accelerometers and infrared detection to sense its position in 3D space when pointed at the LEDs within the Sensor Bar.
Simplified: The Wii Remote uses accelerometers and infrared light sensors (from LEDs inside a 'sensor bar') to know where it is in 3D space.