Fair question. So here we go...Good call on the vent. It really is the key.
The vent in filler cap does two things: Most important is that it allows some air into the sump cavity to replace the reduced fluid volume of in the sump which happens when some of the fluid in the sump is initially moved up into the hydraulic pump. Allowing the air to enter via the vent maintains the atmospheric pressure in the sump. Since the high pressure hydraulic pump is above the level of the fluid in the sump, that atmospheric air pressure is necessary because ultimately that atmospheric air pressure is what forces fluid up to the high pressure pump.
The high pressure pump helps to suck fluid up to itself because when the pump starts to spin it reduces the pressure in its intake line. We call that "suction". but technically it is just different pressures...when the pump spins, air pressure in the sump is higher than the pressure at the intake of the pump, and that higher pressure forces fluid up to the pump.
Now if there is anywhere along the line between the sump and the pump where air can sneak in, then it will. That is called a suction leak. Sometimes it is a tiny split in the end of a hose between the sump and the pump. But can be anywhere. The result is that the pump tries to compress the air into the oil and that makes these microbubbles that make the fluid look cloudy. And just as you say, with a suction leak you won't see any oil leaking out externally until you turn it off. That's because air is being sucked in while it is running. But sometimes when the engine is shut off and just sitting there the suction leak will declare itself by dropping some oil out as the pump's oil slowly returns to the sump because of gravity.
I said that the air vent in the filler cap does two things. Replacing air in the sump is one more thing. The other is that it allows air to flow in and out of the sump as the sump and fluid heats and cools.
Both functions that the air vent does are aimed at maintaining a constant atmospheric pressure on the fluid in the sump.
Does that help?
rScotty