Singularities form under extreme conditions. In the case of black holes, they are the result of the gravitational collapse of massive stars. When a star exhausts its nuclear fuel, it can no longer support itself against its own gravity, leading to a collapse that forms a singularity.