Nanoscale or colloidal particles are exceptionally important in many realms of science and technology. They can dramatically change the properties of materials, imparting solid-like behavior to a wide variety of complex fluids, from yoghurt to cast ceramics. This behavior arises when particles aggregate to form mesoscopic clusters and networks. The essential component leading to aggregation is an interparticle attraction, which can be generated by many physical and chemical mechanisms. In the limit of irreversible aggregation, infinitely strong interparticle bonds lead to diffusion-limited cluster aggregation (DLCA), long-understood as a purely kinetic phenomenon, which can form solid-like gels at arbitrarily low particle volume fraction, φ. Far more important technologically are systems with weaker attractions, where gel formation requires higher φ. Numerous scenarios for gelation have been proposed, including DLCA, kinetic or dynamic arrest, phase separation, percolation, and jamming. No consensus has emerged, and despite its ubiquity and significance, gelation is far from understood; even the location of the gelation phase boundary is not agreed upon. Here we show that gelation of spherical particles with isotropic short-ranged attractions is initiated by spinodal decomposition; this thermodynamic instability triggers the formation of density fluctuations, leading to spanning clusters that dynamically arrest to create a gel. This simple picture of gelation does not depend on microscopic system-specific details, and should thus apply broadly to any short-ranged attractive particle system. Our results suggest that gelation, often previously considered a purely kinetic phenomenon, is in fact a direct consequence of equilibrium liquid-gas phase separation. Without exception, we observe gelation in all of our samples predicted by theory and simulation to phase separate; this suggests that it is phase separation, not percolation, that corresponds to gelation in models for attractive spheres.