From interstellar gas to the Earth‐Moon system