Basically because barometers were invented. That’s the first time air pressure could be measured, and scientists discovered that as you go higher in altitude (eg. by climbing a mountain) the air pressure decreases. So you extrapolate that and find that if you get high enough the pressure would reach zero.
Latest Answers