In most animals, the primary purpose of teeth is prey capture: you grap onto something, and the teeth help prevent it from escaping your maw. They also create punctures, through which digestive enzymes can penetrate into the hunk of food and begin digestion.
As one might expect when using one’s mouth to grapple with one’s prey, some teeth will almost invariably get knocked out. Thus, a replacement strategy tends to be good thing. A good many animals have polyphyodont teeth, meaning they are continuously replaced throughout the animal’s lifetime.
Mammals, not surprisingly, are a bit different. For one thing, they chew their food, which allows digestion to begin in the mouth, rather than waiting until food enters the gut. As such, a simple, continuous replacement is probably not going to be the best strategy. Better to have a set of more permanent choppers which are less likely to get knocked out while grappling with prey, seeing as how those same teeth will be needed to start chewing on your prize, once it’s subdued. Better still to have all of one’s teeth occlude properly; having all of one’s teeth erupt more or less at once helps limit the number of gaps in the chewing surface.
Mammals, in general, have what are termed diphyodont teeth, meaning they only have two generations of teeth. The first set, during the suckling phase (something else which mammals do differently, of course), consists of incisors, canines, and premolars. The second, permanent, set adds molars to the list. Note that during the suckling phase, the teeth don’t tend to occlude nicely. This isn’t generally a problem at this stage, since the animal isn’t really chewing anything.
The replacement tooth forms from a combination of the dermal papilla and the enamel organ, which each lie deeper in the jaw than the roots of the “deciduous” (or “milk”) tooth. As the second-generation tooth grows, it gradually cuts off the nutrient supply to the milk tooth, which causes the root of the milk tooth to be reabsorbed, thus loosening it. Eventually, of course, it falls out, and the second-generation tooth soon takes its place.
It seems to me that such a system would be advantageous because a) during suckling, it probably limits damage caused by devloping teeth to the nursing mother (being bit on the nipple is probably not amongst life’s finer pleasures), and b) once weaned, it was important to have properly occluding teeth for chewing purposes, so further tooth production was simply shut down. This helped ensure that all teeth in the adult would be of the same generation, thus decrease the number and size of gaps between upper and lower teeth.