Why do some airplanes have vertical strakes?
The vertical tail surface is like a wing, maybe with a smaller aspect ratio, but it works much the same over sideslip as a wing works over angle of attack. The fuselage, however, is a slender body with a much smaller lift curve slope, but a much higher "stall" angle. In fact, its lift curve slope is nonlinear and tends to increase with higher angles of attack and angles of sideslip. If you want to know more how the lift curve slope varies with aspect ratio, please read this.

This means that at some sideslip (around 15° for most configurations) the vertical tail stalls and its stabilizing side force decreases with further increase in the sideslip angle, whereas the destabilizing influence of the fuselage increases further. The aircraft becomes laterally unstable pretty soon.

To buy a little more stability around the point where the vertical tail stalls, these strakes have been added. They have a high leading edge sweep, so they will produce vortex lift just like a highly swept delta wing, only sideways. The suction force of this vortex will act on the root of the vertical, just were it has the biggest chord. In fact, this helps to keep most of the vertical active, because now it becomes part of that delta wing ahead of it.

The strakes in the upper picture have a different purpose on top, however. They limit flow separation on the rear fuselage in high speed flight by preventing crossflow. Actually, they are an embarrassment for the aerodynamicist, because they show that the lower fuselage suffers from flow separation just when it hurts most.

Most military cargo aircraft have them, because in order to keep the ramp short and to provide enough clearance for rotation, their tailcones are steeper than what the airflow can manage. Among modern military transporters, only the Lockheed C-5 (thanks to @dotancohen for the hint!) and the Antonov-70 can do without them. This was a definite source of pride for the chief aerodynamicist of the Antonov Design Bureau, Oleg Bogdanov.

The lower fin in the second picture was added to compensate the destabilizing influence of the two floats, which will destabilize the aircraft in much the same way as the fuselage does.

Extending the vertical downwards also helps to improve handling qualities and should be done as much as tail strike clearance allows.