A differential is the driving-axle gear assembly located in the center housing between the driving wheels on rear-wheel drive vehicles, or as part of the transaxle on front-wheel drive vehicles or between front and rear differentials on all-wheel drive vehicles. The differential transmits power to the wheels while allowing each wheel to rotate at different speeds, such as when turning a corner.
Why is it needed to lock the differential in certain conditions? If a wheel loses traction (the wheel is on ice, snow, mud, or raised in the air), an open differential will send all available engine power to that wheel. The wheel will spin, but the car will not move. So even if a vehicle has all-wheel drive, but neither of the three differentials can be locked, it is enough for just one wheel to lose traction (to spin) and the car will not be able to move.
So, to get the car moving, it is necessary to lock a differential. Locked (or limited slip) differentials make (or try to make) the wheels to spin at the same speed, syncronously. This transfers torque from the wheels that spin to the wheels that have traction. Ideally, a vehicle should be able to fully lock all three differentials (center, rear, and front) - in this case the vehicle would be able to move as long as just one wheel has traction.
Figure: Free differential (90KB)
Figure: Limited slip differential (83KB)
Read more: How a differential works