For whatever it's worth, any container loaded to an on-deck position on a container ship at least has twistlocks as Gord mentioned. These are placed in the bottom corner castings of each container as they are loaded and automatically lock into the top castings of the container that they are loaded on top of, or into pockets on top of the hatch
if it's directly on deck
. Also depending on how high they are stacked, the first two or three tiers will also be secured to the hatch
covers with steel
hooks, rods, and giant turnbuckles.
The case of the rolled ship in the picture always looked to me like an accident
caused by loss of stability while working cargo. Any time you pick up a load with a vessel's own cargo gear
like that little ship has, the center of gravity for that piece of cargo moves from its stowed location on the vessel way up to the top of the crane boom, effectively decreasing GM. Once you reach a situation of neutral or negative GM, swinging that hoisted load away from the center line toward the dock
will send the ship over like a fallen tree. This would also explain why the containers are scattered all over the place, as typically lashing is removed and twistlocks are unlocked for all the cargo that is going to be discharged at a given port all at once at the beginning of a vessel's calling.
The lashing system is incredibly strong, but won't save you from bad seamanship...