We know all children are a bundle of raw emotions and tons of energy. The role of parents is to try to help the child to learn to control these emotions and energy so that they don’t become destructive and instead become constructive. Discipline therefore is just teaching children how to control themselves.
Now, there is a huge difference between punishment and discipline. When we talk about punishment, it is more like getting even. When we talk about discipline it is inflicting a far less amount of pain on the person then they might receive if they were allowed to go on unchecked with his actions. For instance, if a small child reaches out to touch a hot stove, a parent is going to grab their hand and maybe slap it. Yes a little bit of pain is inflicted but it is far less than what the hot stove would do if the child was allowed to go ahead and touch the hot stove. That is considered discipline.
So too does God discipline His children, but He doesn’t punish them. Punishment comes when a person wants to hurt someone as badly as they have been hurt. But God’s Word clearly says: “If you endure chastening, God deals with you as with sons; for what son is there whom a father does not chasten? But if you are without chastening, of which all have become partakers, then you are illegitimate and not sons. Furthermore, we have had human fathers who corrected us, and we paid them respect. Shall we not much more readily be in subjection to the Father of spirits and live? For they indeed for a few days chastened us as seemed best to them, but He for our profit, that we may be partakers of His holiness. Now no chastening seems to be joyful for the present, but painful; nevertheless, afterward it yields the peaceable fruit of righteousness to those who have been trained by it.” (Hebrews 12:7-11)