AWD in some vehicles can allow a wheel to spin and take all the power while letting the other wheels that are actually in contact lose their power.
4WD locks the axles so all the wheels turn together. So if you have your front wheels off the ground, they won’t spin and take all the power off the engine leaving the rear wheels dead. Instead all 4 wheels will turn at the same rate so even if the front wheels are off the ground the rear wheels will still have the same power they normally do.
AWD, by its nature of always being on, needs to have slip or give in the differential. This means if you have wheels that are free spinning they’ll usually take up all the power leaving the contacting wheels out of power and generally useless. So if you’re in a ditch, you may have trouble getting out with AWD due to front wheels slipping, while 4WD doesn’t care if the front wheels slip and will keep turning the rear wheels at the same speed as the slipping front wheels.