Young children need firm but positive adult supervision. The discipline that babies get should teach, not hurt. Hurting a baby teaches that adults hurt babies. This can be a lifelong lesson. Don't expect babies and young children to do what you say all of the time.
Young children do things for no reason.
They will hit, yell or fall apart at times because. Their feelings of sadness and anger are often too strong to control. Babies begin to learn self-control when they begin to soothe themselves. They learn to fall asleep on their own and begin to calm themselves with a little assistance from caregivers. Babies learn as their brains grow.