251-201 million years ago
Between the Mid-Carboniferous and the Mid-Triassic, primitive pelycosaurs evolved into advanced pelycosaurs which evolved into primitive therapsids which evolved into advanced therapsids which evolved into primitive cynodonts which evolved into intermediate cynodonts which evolved into advanced cynodonts which evolved into the most primitive mammals. Although modern mammals are very different from modern reptiles, the first mammals were almost identical to the advanced cynodonts.
As pelycosaurs evolved into therapsids which evolved into cynodonts from the Carboniferous through the Triassic, there were certainly a large number of modifications to the ancestral anapsid body plan. What do all these changes mean? Many of them are inter-related, which perhaps can be illustrated by emphasizing two points:
1) Cynodonts were faster, smarter, and warmer than pelycosaurs. Their limbs longer and were held under the body for an upright posture. Their back did not undulate as they moved as in primitive reptiles and their tails were smaller. Expanded bone regions (such as in the vertebrae and hip) allowed for larger limb muscles. These changes would have made them faster. Their brains were larger and there is evidence that from the time of the therapsids, the development of some degree of endothermy had been achieved.
2) All of the above adaptations required more energy. Upright body stance, larger brains, and a higher metabolism which produces excess heat are energetically expensive. Therefore, these ancestors of mammals had to evolve modifications to produce energy more efficiently. They evolved the ability to process their food more efficientlythey increased their jaw musculature, evolved the ability to chew, and modified their reptilian teeth to produce both tearing and grinding teeth. Obviously, greater oxygen supplies would be needed to convert these foodstuffs into energy and so they evolved a secondary palate which ensured that they could continue to breathe, even while eating. The loss of lumbar ribs and the evolution of the mammalian diaphragm muscle allowed them to increase the volume of their lungs when inhaling by pushing down on the digestive organs.
By the end of this process, synapsid reptiles had evolved into primitive mammals.