Strange Facts: Space: Hydrogen 74% / Helium 24%. Earth's Atmosphere has Nitrogen 78% / Oxygen 21%. How did that happen?

Strange Facts: Space: Hydrogen 74% / Helium 24%. Earth’s Atmosphere has Nitrogen 78% / Oxygen 21%. How did that happen?