The connection between the engine and the transmission/gearbox (in an Automatic car) is a fluid coupling called a torque converter. Imagine a big fluid container with 2 sets of propellers in it facing each other – one for the engine and one for the transmission. It’s like the fluid gets agitated by one and it tends to spin the other in the same direction. Even if they are not spinning at the same speed there is still a force transfer applying pressure on the other to turn.
If the wheels can’t turn then all you’re doing is agitating this fluid.
For an automatic transmission that would be due to the torque converter. They are designed basically for what you described: reducing shock to the engine/a way to disengage your engine from your transmission so it doesn’t break. Torque converters are a fluid coupling that have the ability to “slip” so the engine can disengage and not break.
For a manual transmission, your clutch is slipping and you should stop whatever you’re doing immediately. A clutch serves the same purpose as a torque converter, it’s basically two flat planes that “mate” together by default, but can be forced apart to disengage the engine from the transmission. If the engine is spinning but nothing is moving (while you’re in gear) it means the friction material on the clutch that holds it together is being overpowered and it’s slipping. Like if you held down your brakes but the car was still rolling anyways. The material is being burned and you’re destroying your clutch.
Latest Answers