Worked in TV and film. It's incredibly simple and highly regulated. (The crew member assigned to the parents when you do this is a trained professional and social worker. )
Need a baby to cry in a scene? Ready?
You take it away from mom or dad and place it in the actor's hands for the five seconds it takes to record. They cry 95% of the time.
That's it! Movie magic!
And the parents are literally ten feet away, always in eyesight, behind camera. Again, there is nothing more important than the health and safety of children on a modern set.
A lot of it you can fake pretty well by putting some water on their face and a touch of whatever makeup makes your cheeks a bit rosy.
A lot of the cries the babies have are the "I asked for food and it's been three minutes and I haven't gotten it, so I'll ask louder", or "I just woke up and forgot I have hands"
Fun fact: For the movie Zone of Interest they used real audio of screaming. They went to Paris when the police were beating protesters and recorded the audio.
There is an episode of All In The Family (filmed in the 70s) where Archie is trapped in an elevator and a baby is born there. Offscreen, a loud noise is heard, followed by the sound of the baby crying