This startle reflex (aka moro reflex) is/was present in us as newborns.
It's triggered when there's an unexpected reaction. Example: Loud noise, sudden movement.
The baby will tighten his/her body, fling out arms, sort of like giving him/herself a hug. It happens because the baby is trying to protect itself from harm.
It normally leaves thanks to the mother's care, normally 6 weeks after the newborn is born.