This is a late answer; a recent question was marked as a duplicate of this.
The phenomenon discussed in the question goes under the general concept of the dynamics of sloshing liquid. Sloshing liquids can overturn tank trucks, derail railroad tanker cars, capsize ships at sea, crash aircraft, and cause spacecraft to lose controllability. This makes this a very important concept for economic and safety reasons and hence is the subject of many journal articles and entire technical books.
The dynamics of slosh are nonlinear, rather complex (particularly so if the sloshing is extreme and creates bubbles), and are highly dependent on container geometry. As a general rule, a container that is nearly full or nearly empty of fluid doesn't slosh much, and sloshing is at its worst when the container is close to half full.
Excitations from vehicle suspension, from vehicle acceleration and braking, from ocean waves, and from the control systems of aircraft and spacecraft can turn low amplitude sloshing into high amplitude sloshing, something that is best avoided.
But I'd like to see a mathematical explanation of this phenomenon.
You are inadvertently asking me to write a lot. Go to scholar.google.com and books.google.com and search for "slosh dynamics" and you'll see how much has been written on understanding and mitigating slosh. I'll instead provide an overview.
Most slosh models are a bit ad hoc. A simple approach is to model the fluid as being partitioned into a fixed part (one that moves with the container) and a sloshing part, with the sloshing part modeled as a spring/mass/damper system or as a damped pendulum system. The slosh wave slams into the container wall, and this has to be modeled as well. This works well for low amplitude slosh, not so well for high amplitude slosh. These low amplitude slosh models yield a natural slosh frequency. These models predate modern computing.
More recently, slosh has been studied using computational fluid dynamics, and even more recently, with smoothed-particle hydrodynamics originally developed by astrophysicists to model galaxy formation, star formation, supernovae, etc. The same techniques work quite nicely to model more mundane fluids such as sloshing in a container.