Why do people name their child one name with the intention to o call them a different name (nickname)?

I don’t understand why people name their child something with the intention of calling them something else.

Named daughter “Amelia” with the intention to called her “Amy”.

Named son “William” so you could call him “Bill”

Why not just name them the name you want to call them? I truly don’t understand.

I do understand a nickname coming along the way, throughout childhood or what have you. I just don’t get why before the baby is born, do you name them “ “James” so I can call him “Jim” “?

Edit: Diminutive is the shortened version of one’s name, not a nickname.