We now know that Cepheids throb as they do because they are elderly stars that have moved past their “main sequence phase,” in the parlance of astronomers, and become red giants. The chemistry of red giants is a little weighty for our purposes here (it requires an appreciation for the properties of singly ionized helium atoms, among quite a lot else), but put simply it means that they burn their remaining fuel in a way that produces a very rhythmic, very reliable brightening and dimming. Leavitt's genius was to realize that by comparing the relative magnitudes of Cepheids at different points in the sky you could work out where they were in relation to each other. They could be used as “standard candles”—a term she coined and still in universal use. The method provided only relative distances, not absolute distances, but even so it was the first time that anyone had come up with a usable way to measure the large-scale universe.
(Just to put these insights into perspective, it is perhaps worth noting that at the time Leavitt and Cannon were inferring fundamental properties of the cosmos from dim smudges on photographic plates, the Harvard astronomer William H. Pickering, who could of course peer into a first-class telescope as often as he wanted, was developing his seminal theory that dark patches on the Moon were caused by swarms of seasonally migrating insects.)