Analysis of 250,000 stars sheds light on the formation of the Milky Way