It's a cry for help. They learn it at their birth, when they fall out of the nest. Falling out of the nest is not the worst thing (in case they survived). The worst is when a predator comes by to eat them. In case a predator catches them they cry for their mommy to save them. I once picked up a young crow which hurt it's wing. When I picked the crow up it started making a squeeky sound and immediately mother crow came out of the tree and started attacking me by flying close to my head trying to pick me.
Same counts for grown-up birds, it's an automatick response because they are very vulnerable to predators and by crying out, they warn other birds for predators.