Hydrogen and helium are only found in small amounts in the atmosphere because they can easily achieve escape velocity, buoyancy only applies to enclosed bodies submerged (or partially submerged) in a bulk fluid, not to individual molecules. The vertical distribution of gases in the atmosphere is actually pretty constant up to very high altitude, the main exception being water vapour since its saturation depends on its vapour pressure and it can change phase at atmospheric temperatures and pressures.
Of course there can be temporary localised pocket of significantly different composition but the equilibrium state of any mixture of gases is an even distribution, regardless of their molecular weights. The principal reason for this is the large intermolecular distances (a defining property of a gas) and the fact that gas molecules are, by definition constant moving in random directions at any temperature above absolute zero. This means that gases will rapidly mix with each other even without any bulk flow.
The imiscibility of oil and water is not related to their relative densities but the type of forces between the molecules, sugar for example is completely soluble in water and sugar and water will remain thoroughly mixed indefinitely despite the fact that sugar molecules are much heavier than those of water.
Question what's giving hydrogen the energy to reach escape velocity?
I know there's a lot I don't know but fluids are fluids no matter if they're a liquid or gas the same laws apply to both. Yes all fluids want to find equilibrium but equilibrium does not mean an equal/homogeneous mix it means finding the lowest energy state needed to maintain its self or finding balance for short. You’re right fluids of like mass and density will mix because that’s a lower energy state then maintaining fluids the separately. But gravity and mass still plays a part in a fluid reaching equilibrium, after all it takes energy to hold a higher mass fluid above a lower mass fluid in a gravity well.
It’s the reason cold dense fluid sink and hot less dense fluids rise.
Gravity is the force that makes buoyancy exist, higher mass and/or denser matter get pulled to the center of mass displacing the lower mass less dense mater. This also the where hydrogen gets the energy to reach escaper velocity, on its trip up the higher mass gases displace the hydrogen transfer energy to it.
You’re sugar analogy is flowed because the sugar bonds to the water while gases do not and yes there’s more going on in the oil water mix then just mass it is still part of it. Also the why less dense oil floats on water.
Temperature can defined as the mean kinetic energy of all of the molecules in a body. In a solid the molecules are constrained by fixed but elastic chemical bonds to their neighbours so their movement is limited to vibration about a particular point.
If the temperature increases the energy of the molecules is enough to begin to break down these bonds, the temperature at which this occurs for a given substance is also affected by pressure. At this point individual molecules are able to move relative to each other but are still closely packed. Liquids therefore are able to flow freely but are incompressible. There are still attractive forces between the molecules which are responsible for adhesive and cohesive forces (eg surface tension) but these are relatively easily broken and reformed. There are several different types of intermolecular force which act in this way usually the result of small variations in charge or magnetic dipoles. These forces are much weaker than the chemical bonds which hold the constituent atoms of molecules together. Solubility of one substance with another is largely dependent on the dominant type of intermolecular forces involved.
In the gas phase the kinetic energy of the individual molecules is great enough to overcome the attractive forces between them entirely so gases exhibit no coherent structure at all. The distance between any two molecules is random (within the confines of their container) as is the distribution of their velocities. What is a constant is that all of the molecules in a gas will have non-zero velocity.
Individual gas molecules will frequently collide with each other, exchanging momentum, this means that macroscopic differences in energy between regions of a gas will even out relatively quickly. Since kinetic energy is defined as 1/2.m.v2
a less massive molecule at a given temperature will tend to have a higher velocity than a more massive one (I say tend to
as in a bulk gas the distribution of velocities of individual molecules is random) this means that at ambien atmospheric temperatures it is quite probable that a given hydrogen or helium molecule will have a velocity greeter than that required to escape from the earth's gravity well.
Buoyancy on the other hand is a macroscopic bulk property of bodies immersed in a fluid, the concept cannot apply to individual molecules.
Note that although the gravitational force
on any given body is proportional to it's mass (F=m.g) it's acceleration due to gravity is independent of it's mass as mass appears on both sides of eh equation F = m.a which gives F = m.a = m.g ---> a = g Therefore the effect of gravity on the velocity of a gas molecule (or anything else) is independent of it's mass.
It IS possible for distinct layers of gas to form eg a dense gas collecting at ground level, however this is a temporary and unstable state which is a result of the initial conditions of the system. A mixture of gasses at equilibrium conditions will exhibit a random distribution of positions and velocities of its constituent molecules. Separating them is only usually possible by some chemical process or if the temperature drops below the boiling point of one but not the other.