Babies are full of reflexes. They have around 70 reflexes, which are primitive and down to evolution. You may notice when you hold your child upright with his feet on the flat surface; then his legs will work with a stepping motion.
It makes the child fling his arms up and out, draw his knees up, and open his fists wide before going to his original position.