Why does mass take shape of things?

Flexi Says:
From the shapes of molecules to galaxies and everything in between, the shape that mass takes results from interactions among only four fundamental forces. These forces are:
- the strong nuclear force, which holds particles together to form atomic nuclei
- the weak nuclear force, which maintains the balance of particles in atomic nuclei
- electromagnetism, which causes charged particles to attract or repel
- gravity, which causes masses to attract one another
In general, the nuclear forces hold fundamental particles together to form atomic nuclei. Electromagnetism determines the shapes that are formed when atoms bond together, such as in molecules or crystal lattices. Gravity shapes much larger masses, such as planets and stars. Most familiar objects on Earth's surface are shaped by interactions among electromagnetism and gravity. The shape that any specific mass takes depends on which of the forces are dominant, which in turn usually depends on the amount of mass present and characteristics of the mass such as state, polarity (charge), and density.