is the tendency of a system to return to its initial state after a disturbance. Typical disturbances in case of airplanes are:
- Flying into a vertical or horizontal gust
- A jerk on the stick
The classic explanation is with a ball sitting in a pit. Whenever its position is changed by a disturbance, it will roll back towards the center. This does not mean that it will stop there - in an ideal world free of friction it will keep moving back and forth like a pendulum.
This is static stability. Broadly speaking, static stability is achieved by placing the center of gravity ahead of the neutral point, the point in which all additional forces due to a change in angle of attack can be summarized. There are two neutral points, one for longitudinal stability and one for directional stability. In both cases the change in angle of attack or sideslip will create a correcting moment around the center of gravity, pulling the aircraft back on its old path.
Even altitude stability can be achieved, but here we take advantage of the fact that air becomes less dense the higher you climb. If the aircraft is trimmed for horizontal flight at a certain altitude, an altitude change will mean that the power setting does no longer match drag at this new altitude. The aircraft will either climb or sink, depending on the altitude change, until the old altitude has been reached again.
In all cases you will experience overshoots and oscillations around the trim point. It can even happen that these overshoots become worse the longer the oscillation lasts (the phugoid motion in a glider is a good example). To stop the oscillations, you need to add
which describes the behavior of the aircraft over time. In most cases, friction will ensure that motions die down, and sometimes aircraft need little helpers like yaw dampers to get those under control.
You mention stalls and dives: They can indeed occur in a statically stable airplane. Low drag means low damping, therefore many high performance gliders have a dynamically unstable phugoid motion. I know, Wikipedia spells this wrongly, but the explanation is OK, so I linked it nonetheless. If you wait long enough after an initial upset, the oscillations will become so severe that the aircraft stalls at the upmost point of the cycle.
If you keep enough altitude and have no traffic nearby, this is fun to try.
Note that I omitted to say something about roll stability so far. The glider (and your Cessna 172) will also start to roll, and in many cases the roll motion will increase more quickly than the phugoid, so you might need to try several times before you get a phugoid-induced stall. Most aircraft have a weak tendency to increase roll angle and to eventually fall into a spiral dive.
There is no aerodynamic mechanism to right the aircraft up after a roll disturbance. Sorry, @kevin, but dihedral won't help - it only works in case of sideslip.