The hull rolls with the sea state and the corner castings transmit the inertial load. Colour shows corner utilisation (green → orange → red).
$$P_{corner} = \frac{(N-1)\,m\,g\,G_v}{4},\qquad SF = \frac{M_{restore}}{M_{overturn}}$$
N: number of tiers, m: container mass, g = 9.81 m/s², G_v = 1 + 0.5·G_l: vertical multiplier from sea state, SF ≥ 1.5 recommended (IMO CSS Code).
$$G_v = 1.0 + 0.5\,G_l, \qquad T_{lash} = 0.5\,m\,g\,G_l\,N$$
G_l: lateral acceleration from sea state (calm 0 g, moderate 0.3 g, rough 0.6 g, storm 0.9 g). T_lash: total lashing tension required at the bottom tier.
$$M_{overturn} = N\,m\,g\,G_l\,\frac{H}{2},\qquad M_{restore} = N\,m\,g\,\frac{W}{2}$$
H = N · h_cont: total stack height, W = 6.06 m: container footprint length (40ft). The smaller the overturning moment relative to the restoring moment, the higher the safety factor.