Oh boy, that could take a while.
On a basic Jeep without lockers you can get stuck like you described.
In 2wd mode, only one rear wheel will make power. Power always goes to the wheel with the least resistance. When you engage 4wd, the transfer case locks the front drive shaft to the rear drive shaft and the front axle turns. This will also power the front wheel with the least resistance. The result is that if you have one wheel forward and one wheel in the back off the ground, you can get stuck.
The differentials are both open and they are designed to operate this way. If you have lockers, the differentials will lock up allowing both wheels on the same axle to rotate at the same speed. But on the street, that causes binding.
Some jeeps have limited slip differentials which will get power to both wheels better.
When you have an open differential and you get stuck, you can apply the brakes and the throttle. This will sort of create a limited slip by slowing down the wheel that is spinning