Why do the planets in the solar system orbit on the same plane?

The Earth is about 4.5 billion years old. Liquid water and rocks were present by at least 3.8 Byr-ago. along with rare-earth elements. At what point does the flat "dust" in the solar system become planet building materials...silicates and other rock-forming minerals, not just gases.