Answer is a baby doesn’t know, it is the function of the muscles working together. It happens on a level we are not conscious to.
Your breathing apartus links ear, nose, and throat passages. I push on your chest, air flows. It isn’t “genetic”. It’s the design. Same as if I step on a paper bag with air in it.
If you can’t explain to me how instinctive (meaning unlearned) behaviors are happening, then we can go no further with this conversation. You appear to think it’s some sort of magic.