How the Milky Way got its spiral arms