Why do we discipline children? While there may be many reasons, ultimately I believe:

We discipline to teach children there are consequences to their actions.

We know instinctively that everything we do has some consequence, even at the simplest levels. If we turn on a tap over an empty glass, the consequence is the glass is filled with water. If we push a tall box, the consequence is that the box falls and possibly causes something to break. As adults we know that we are responsible for dealing with the consequences of our actions, but that’s not something children understand. As very young children we’ve done everything for them, so they see us clean up their mess at the table and put them to bed when they’re tired. They can’t take responsibility for their actions when they’re very young, but as adults they will do this almost 100% of the time. So between infancy and adulthood they need to progressively learn this.