What is it that distinguishes one atmospheric layer from another?
What is it that defines where one layer stops and another starts?
Temperature. More specifically, it's whether temperature rises or falls with increasing altitude.
In the troposphere, temperature generally decreases with increasing altitude, at an average rate of 6.4 °C/km (the environmental lapse rate). This decrease stops at the tropopause, the boundary between the troposphere and the stratosphere. The ozone layer is in the stratosphere, making temperatures in the stratosphere increase with increasing altitude. While this boundary is a bit fuzzy, it is still very real. It takes an incredibly strong thunderstorm (think hurricanes, storms powerful enough to spawn tornados, and very tall and strong storms in the Inter-Tropical Convergence Zone) to penetrate that boundary.
Temperatures in the stratosphere stop rising at the stratopause, the very fuzzy boundary between the stratosphere and the mesosphere. Like the troposphere, temperatures in the mesosphere fall (and fall very sharply) with increasing altitude. Thermodynamics makes the boundary between the stratosphere and mesosphere very different (and not nearly as clear) as the boundary between the troposphere and the mesosphere.
The boundary between the mesosphere and the thermosphere is similar to the boundary between the troposphere and stratosphere. Temperatures rise with increasing altitude in the thermosphere. This change from falling temperatures in the mesosphere to rising temperatures in the thermosphere makes for a rather stable boundary.
Something else happens near that boundary between the mesosphere and the thermosphere. Long-lived gases are fairly well-mixed in the troposphere, stratosphere, and mesosphere thanks to turbulence. Gases in the thermosphere and exosphere act more like a bunch of individual particles rather than a gas. Unlike the dense layers below, gases in the thermosphere and exosphere are differentiated. The makeup tends toward lighter and lighter particles (e.g., helium and hydrogen) with increasing altitude. Eventually, all one finds are hydrogen and helium. These are the gases that escape from the atmosphere.