Normally the flow of power goes from the transmission to the rear wheels through the driveshaft. However, when you shift into 4WD that power has to be split between the front and rear wheels. The transfer case makes this split happen. When you shift into 4WD, gears are engaged to power a chain drive that runs from a gear driving the rear driveshaft to power another set of gears behind the front driveshaft. Once engaged, this driveshaft delivers power to the front differential and out to the front wheels.