Ancestors of Mammals
Humans are mammals, the most successful taxonomic class of organisms to colonise the Earth. The word mammal derives from the Latin meaning of breast, "mamma", where breasts are a consistent trait among mammals in mothers feeding for feeding their young. Coincidentally, the more scientific name for the breast is the mammary gland, which further illustrates the point.
Mammals are a diverse group of organisms, where the majority of them develop their offspring within the uterus of the mother, though exceptions are noted. For example, monotremes lay eggs, like their common ancestors the reptiles and birds.
To further diverse, over time mammals have diversified into the placentals and the marsupials. But before we get into that, first look at the ancestors of the mammals to get a better understanding of how the mammals became dominant in the first place, in accordance with natural selection and geological events.
Ancestors of Mammalia
The taxonomic class Mammalia is within the Vertebrata phylum, which elementarily suggests that the direct ancestors of mammals were vertebrates. This is true of course, as it would have allowed taxonomists to order the species in light of this.
Over three hundred million years ago, when life was beginning to conquer dry land, reptiles had adapted from their ancestors to live on the land, and acquire an ecological niche that otherwise had no competition.
It is believed that a niche of reptiles deemed the paramammals, which have sufficient distinctions between both reptiles and mammals, to suggest that mammals indeed evolved from reptiles.
Circumstantial Change
Although some reptiles were beginning to possess mammal-like features, it was not for another 50 million years that the first distinctive differences were being noticed in species. Land animals were continuing to diversify and occupy new ecological niches and move away from competitive environments. Herbivores soon diversified from the reptiles, while dog-like species were becoming dominant as a competitor to the more reptile-like creatures.
These dog like creatures were beginning to diversify in the land environment, and become a true competitor for land resources, unlike the more water-dependant reptiles. Characteristic changes like cold to warm-blooded, prolonged front teeth, fur and mammary glands helped taxonomists note the difference over time from the transition from reptiles to more mammal like creatures