Why don't green house gases escape into space?
The reason the atmosphere (including GHGs) stays attached to the earth is gravity. This is called the Hydrostatic Equilibrium. There is one GHG that this does not fully apply to: water vapor. While water vapor can be considered to be in hydrostatic balance, the fact that it undergoes a phase change (and becomes dissociated if it reaches too far up) prevents it from being more evenly distributed vertically like $\ce{CO_2}$ or $\ce{CH_4}$.