The vacuum motor engages a sleeve internal to the front differencial that locks the two front half shafts togather.
This all happens at the same time the request switch is operated for 4wH or 4wL.
There are electric solenoid vacuum valves on the firewall that do this in response to your selections.
If you do this at idle, you should hear a 'clunk' when the front axle vacuum motor operates.
Otherwise, in 2wd, the front trans drive shaft does not turn because the transmission has not shifted to engage the front drive shaft or the vacuum motors to lock the front half shafts togather.
The combination of electronic control, transmission power flow changes and front axle engagment is what baffles most when they have an issue.
Each part of the operation must be understood to solve an issue unless one is lucky.