The term 4WD simply means "4 Wheel Drive". That means that the torque of the engine when accelerating can be applied to all four tires as opposed to the front ones with FF and rear ones with FR. A 4WD is used to describe a truck-like vehicle where the driver must manually switch to 2WD (2 wheel Drive; only the rear recieves torque) for road conditions and 4WD for other conditions such as ice, snow, or offroading. This is not to be confused with AWD (All Wheel Drive), which is what present production vehicles sometimes have, which cannot be disengaged like a 4WD by locking the center differential, but will not destroy the drivetrain when used on pavement like a 4WD would. 4WD has the advantage over FR and FF in the way that in the case of a wheel spinning out of control, traction control acts on all four tires instead of the two driving wheels in other types, meaning that 4WD cars will see much greater resistance to wheel spin.
The two most common locking differentials are computer controlled multiple-plated clutches or a VCU (Viscous Control Unit) to join the two driveshafts. In the clutch system, when there is a slip in traction, the conputer locks the shafts, which can sometimes actually make the situation worse for the driver. In the VCU system, the stress of the slippage causes a fluid inside it to harden, joining the two driveshafts. However, its performance degrades over time and becomes at greater risk for a lock of the driveshaft. Some use gears to cause a small difference in rotation to transfer torque where it's needed quickly.
Related ThreadsBest Car for Class FF, FR,, MR, 4WD, Rally - last post by @ Aug 30, 2017
Tuning a 4WD... - last post by @ Sep 7, 2001