The somewhat longer answer is that the device that makes what you're asking possible is the torque converter. This device is a pair of curved blades setup as an impeller, and a turbine. The following cutaway pictures illustrate this setup:
Here is a torque converter split in half for a better view:
The way this works is explained really well by a You-Tube video here:
https://www.youtube.com/watch?v=z5G2zQ_3xTc
Here is the gist of it. The turbine is attached to the engine and rotates at the speed the engine does. The pump is the other set of blades, and it is attached to the output shaft which goes to the transmission. The only connection between the two sets of blades is a viscous fluid (transmission fluid). At idle, the converter is in a phase called stall. No power is transmitted because while the turbine is spinning with the engine, which causes fluid to flow into the pump, the pump doesn't move because it is attached to the wheels which are held by the brakes. When you release the brakes, you move forward because the fluid driven by the turbine into the pump causes the pump to move which gets sent to the transmission.
Bottom line, the reason this works is because there is no solid mechanical connection between the engine and the wheels. One of the links in that chain (the torque converter) only connects the engine to the transmission by two sets of turbine blades that face each other and are only indirectly driven by the force of moving the viscous fluid.
Here is a link to a You-Tube video that demonstrates how the converter works using two fans. It really helps to visualize how the two turbine blade sets work together, and how the system works.
https://www.youtube.com/watch?v=pTfipsejqS0
I hope that helps!