In common understanding, by capsizing people generally mean a sudden passing of a ship from the upright position to the upside down position. More precisely, capsizing or loss of stability can be defined as exceeding the amplitude of rolling or a heel at which operating or handling a ship is impossible for various reasons.
A ship can capsize because of the variation of the metacentric height GM, or of the righting arms GZ, in head or following seas (parametric resonance) or due to the loss of control in severe following or quartering seas (broaching-to phenomenon). Nonetheless, a ship can capsize even in port if the metacentric height is negative.
Further reading: “Ship Stability in Practice”