Even an irregular shape can balance without falling if you place it on exactly the right point. That point is the centroid. Drag the vertices to change the shape and see how the centroid moves.
How to find it in practice: If you hang the shape from any vertex, the centroid lies on the vertical line below that point (the line of the hanging plumb). Hang it from two different vertices and draw the two vertical lines: the point where the two lines intersect is the centroid!