Active ectotherms have much higher oxygen requirements, necessitating breathing when eating. The modification of the existing structures from earlier reptiles is functional and rarely dangerous, which is all that is necessary for this trait to be passed on to some extent.
Work Step by Step
Mammals could not go without breathing when eating, so an adaptation that allowed them to do so would have to go hand in hand with this. The esophageal opening is further back and not directly in the mouth, as it is in earlier reptiles. This is a functional modification of an existing structure, not the total re-writing of anatomy.