As Steven Taylor explained, initially humans sent Mechonoids to prepare Mechanus for colonisation, but Earth got caught up in interplanetary wars such as the Human-Draconian War, and the Second and Third Dalek Wars. No one was bothered with the abandoned Mechanoids, figuring they would run down or wear out, but the Mechanoids constructed their city and repaired themselves, continuing to function (PROSE: The Chase) even though the colonists never arrived. Steven Taylor crashlanded on the planet and was taken prisoner by the Mechonoids for several years, before being saved by the First Doctor and his companions as the Mechonoids and their city were destroyed by the Daleks, while the travelers escaped in a Dalek time machine and the Doctor's TARDIS. (TV: The Chase)
The Government decided to open up this arm of the Galaxy, and sent out a fleet of ships to terraform any marginal planets. This place was one of them, and the shipful of colonizing robots came down to clear the landing sites, start building and generally make things as perfect as they could for the colonists. […] Earth got into the Draconian conflict, then the Third Dalek War. That ended the population expansions problem pretty drastically, and this arm of the Galaxy was promptly forgotten.
Shortly after encountering the Mechonoids, the Daleks set the rogue planet Skardal on a collision course with their home world, but the Zerovians' robot agent 2K prevented Skardal from destroying Mechanus. (COMIC: The Rogue Planet, Impasse)