Baby teeth are more scientifically called deciduous teeth, because they are shed like leaves.
They are also called milk teeth, which is a clue to the answer.
Mammals, with a few exceptions, have two sets of teeth. The key to mammalian success is specialized teeth for many different foods, and two sets, often with different mixes of types, provide for even more adaptability as the animal grows and changes diet.
There are three basic kinds: incisors, to bite and gnaw, like the beaver, whose hard-worn teeth grow all its life; canines, to stab and seize, like the dog or tiger, and molars and premolars, to grind and chew, like the cow.
While mammals are little and growing, the initial source of food is milk, and they do not need teeth at all.
The first teeth emerge and develop as needs change; they may have some utility for eating solid foods. Then, as the animal gets a full-sized jaw, it loses the baby teeth and the second set of teeth emerges for the adult diet.
Some mammals have more than two sets and some have none.
The baleen whale’s teeth never erupt above the jaw. Anteaters do not need them for their diet of termites and ants.
Some herbivores have one set of molars that continue to grow through life. And elephants, with their diet of coarse vegetation, have six sets of molars to last them through their long lives.