OK, coupla things here. Lemme do my best.
The hub is a rotating assembly that is fixed to the steering knuckle (part where your steering connects to the axle) on both sides - they are what your wheel bolts to. The hub is also conected, on the other side, to the U-joint - which turns with the axle shaft.
All 4wd hubs must lock somehow or no power would get to the wheels.
Some hubs, I'm thinking of Warn in my head here, are manually locking. You would have to put the transfer case in "4WD", get out of the car and turn these switch gizmos at the center of your wheel to lock the hubs in position (now, the outside of the hub & attached wheel assembly and the inside of the hub & axle shaft) are all locked together - you hit the gas, all four tires are moving (or the torque converter slips, or you stall the engine, or you break something, or...)
On a stock XJ, at least on my 98, the hubs are always locked. When the car is moving, the front axle shaft is turning & so is the front driveshaft. All I have to do to get all four tires moving is pull the transfer case switch back a notch & there I am - slipping the torque converter, breaking parts or moving forward.
A differential or "diff" is the center section of the axle - the big bulgy part your driveshaft connects to. Through a mechanical contrivance I won't try to explain here, from the factory it will allow for differences in wheel speed side to side - as you turn, the "outside" tire wants to move faster than the "inside" tire. The problem is that this same mechanism will allow one wheel to spin super fast (on snow, for instance) with no engine power reaching the tire with traction. One tire spins, the other sits still, jeep goes nowhere.
With a differential "locker", both tires spin at the same speed. No matter what - if it is engaged, both tires are moving. Great for traction, not as good for turning radius.
Two different things. Hope this helps...
& GO ME! 600 posts...