Engine power enables a vehicle to get moving and to continue moving.
Traction is the resistance or friction happening between each tire and the ground surface.
In 2WD the traction (resistance) of only two wheels is used. The other two tires have traction as well, but they are just rolling along. In rear wheel drive vehicles they are used to steer the vehicle.
If more torque is applied than there is traction available, the 2 powered wheels will break lose and start spinning. Once the tires are spinning, we say "we lost traction".
So, if in need of more torque to move more weight or to accelerate faster, more traction is needed - otherwise you would lose traction.
More traction can be achieved by sending driving force to the unused axle and simply using the traction of the other 2 wheels.
So, in 2WD driving force is directed towards 2 tires. The traction of those two tires has to support the engine's torque - each powered tire has to deal with 50% of the generated torque.
In 4WD driving force is directed towards 4 tires. In 4WD the traction of all 4 tires supports the engine's torque - at each powered tire has to deal only with 25% of the torque created by engine, transmission, transfer case, and axle.
Since each tire in 4WD has to support a much smaller torque load (25% instead of 50%), it is much much less likely for the tires of a 4WD to break lose. That is why, for example, a 4WD can climb much steeper grades than a 2WD. Because much more torque is needed to move the vehicle up a steep grade, and only when the higher amount of torque is supported by 4 tires instead of 2 tires one can be sure to avoid slipping tires. First implemetation of this concept was during the year 1900
All this is true as long as all 4 tires are find the same surface conditions and each wheel is carrying 25% of the vehicle's weight.
The very moment one tire gets onto a surface with less friction (resulting in less traction) than the other wheels -- the reduced amount of traction will be overwhelmed by the amount of torque received and the tire starts spinning.
The very moment one tire, due to rolling into a small rut for example, gets to carry less than 25% of the vehicle's weight (also resulting in less traction) -- the reduced amount of traction will be overwhelmed by the torque received and the tire starts spinning.
When the amount of torque applied is too much for the amount of traction available, we will get a spinning wheel. Often the wheel diagonally opposed to the spinning wheel will also start spinning.
4WD was invented to use the traction of all 4 tires to either move more weight or drive on surfaces with marginal traction, or both . Differential locks and traction control were invented to counteract or prevent wheels spin.