Imagine a thin stick that you place on the floor and you want it stand. If you succeed to put the stick so as its weight, considered as acting on the center of mass, pass through the point $O$ of contact with the floor, the stick will stand. Otherwise it will fall.
Let's see why. Let's decompose the weight of the stick into a component along the stick, and one perpendicular to it. The latter component creates a torque around the point $O$. Let's calculate this torque.
$$\tau = g\int_A^B R \ \rho (R) \ \text dR \tag{1},$$
where $R$ is the distance from the point $O$, $\rho$ is the density of the stick per unit length, $A$ and $B$ are the extremities of the stick.
Now let me express $R = R_0 + r$ where $R_0$ is a point whose meaning will appear below. We get
$$\tau = g R_0\int_{R_A - R_0}^{R_B - R_0} \rho (R_0 + r) \ \text dr \ + g \int_{R_A - R_0}^{R_B - R_0}r \ \rho (R_0 + r) \ \text dr. \tag{2}$$
Well, the 1st integral gives
$$\tau = g R_0 M = GR_0 \tag{3}$$
where $G$ is the weight of the stick, and this is the final result if we choose the point $R_0$ in such a way that the 2nd integral in (2) be zero. The point $R_0$ for which the 2nd integral in (2) vanishes is the center-of-mass. As to the result (3), it says that the torque imposed by the weight of the stick is equal to the distance to the center-of-mass, $R_0$, times the weight of the stick as if it were concentrated, all of it, in the center-of-mass.
Two simple examples If the stick has uniform density, then the 2nd integral yields the expression $g\ \rho \frac { (R_B - R_0)^2 - (R_A - R_0)^2}{2}$ which is clearly zero for $R_0$ chosen in the middle of the stick. But if, say, the lower third of the stick is has four times the linear density of the rest, the 2nd integral is zero for $R_0$ chosen at 1/3 height, i.e. $R_A - R_0 = -L/3$, where L is the stick length, and $R_B - R_0 = 2L/3$. Indeed, $g\frac {1}{2}[-4\rho \frac {L^2}{9} + \rho \frac {4L^2}{9}]$.