Welcome to the forum
2004 has Live Axle up front, this means front axle and driveshaft are always moving when vehicle is moving.
4WD just connects front driveshaft to the engine/trans via transfercase.
Powering the front wheels causes torque on parts that are normally dragging when in 2WD.
And there are no noises in 2WD when you apply the brakes hard or accelerate hard?
The whining noise means its rotational
Bang or cluck could be suspension
But the two together means where rotational parts meet is most likely problem
There are 2 CV joints, one on each wheel, and a CV/propeller joint on the front drive shaft.
CV joints at the wheels are always used, spinning, and used more when turning, so would expect it would be noising or clunky in 2WD as well.
CV/propeller joint were problems on the Rangers/explorers but also tended to make a noise in 2WD not just 4WD, but this is a likely candidate because of the history.
Front differential could be likely and adding power does change things, but I would expect the noise in 4WD during velocity changes, i.e. adding power then decelerating, not randomly.
So don't have a specific answer for you