It is a joke with a physics lesson hidden inside it. “From scratch” in a kitchen means flour instead of a shop-bought crust; Sagan takes the phrase at its word and pushes it all the way down. A pie made truly from scratch needs carbon and oxygen and iron, and none of those were on the ingredients list at the beginning of time. They were manufactured inside stars, and released when those stars died.
That is the argument of the ninth episode of Cosmos. Wikipedia’s summary of “The Lives of the Stars” has it opening on exactly that extrapolation — a pie taken apart into atoms and subatomic particles — before turning to red giants, supernovae, white dwarfs, neutron stars, pulsars and black holes. The apple pie is the hook; stellar nucleosynthesis is the point. It is Sagan’s whole method in one sentence: start in a kitchen, end at the origin of matter, and never once make the listener feel stupid.
A pie made truly from scratch needs carbon, oxygen and iron — and none of those existed until stars made them.
How the book and the series fit together
The book was not adapted from the series so much as built alongside it, and its thirteen chapters run in the same order as the thirteen broadcasts. The Internet Archive’s catalogue record for the first edition ↗ lists them, from “Shores of the cosmic ocean” through “Lives of the stars” to “Who speaks for Earth?” — the same closing title PBS broadcast on 21 December 1980.
It worked on a scale science broadcasting had not seen. The companion volume ↗ spent 70 weeks on the New York Times best-seller list and sold in the millions, and the series ↗ won Emmy and Peabody awards. Which is why a throwaway line about dessert is now one of the most quoted sentences in popular science.