As stated, essentially what happens is that in 2WD the axle is disengaged and the front wheels are only connected to the brakes and tie rods (steering wheel); engine never touches it.
Engaging 4AUTO binds the front wheels to the front axle so the wheels always drag the axle to turn it (and technically slow braking due to physics and related boring terminology to stop that moving axle) though it is still disconnected from the engine and rear wheels due to a disengaged transfer case (located right after the transmission, before the drive shaft to the rear axle). However, with the front axle bound, that transfer case (through a clutch similar to an automatic transmission) can deliver power on demand to the front wheels, and even slip a bit so power is still delivered while they can spin at different rates without binding.
This means that, contrary to popular belief, emergency stopping performance (using only brakes, not engine braking) is slightly decreased in 4Auto, while forward movement and control as well as engine braking is increased at the expense of gas mileage.