You’d be surprised. In truth, magnemite breed anywhere there’s human settlement. They feed off of electricity and trash, so anywhere there is urban development—especially abandoned urban development—magnemite and/or its evolutions will be there. A bit like cockroaches, actually, only if cockroaches were larger, made of steel, and liable to electrocute you. They might not seem all that likely to adapt, but then again, they don’t exactly need to. Their specific food sources are plentiful enough that they quite simply don’t have to struggle for survival. All they have to do is breed enough in their chosen environments and perhaps resist most things that try to kill them.
In other words, to answer both of your questions at once, magnemite aren’t entirely numerous or adaptive; they’re more likely to form small communities in urban areas, as they’re attracted to high concentrations of electricity. Of course, it’s impossible to say for certain how every single magnemite population came to be, although the going theory is that they simply come attached to heavy construction equipment or other shipments from foreign areas, then detach, seek out an appropriate nesting area, and begin developing a population.
So … once again, very much like cockroaches, only if cockroaches were larger, made of steel, and liable to electrocute you.
(As for why few other species are quite as successful … that is a bit of a mystery too, admittedly, although it may have something to do with how excellent magnemite are at stowing away and allowing humans to carry them, even inadvertently, from one habitat to another.