Hebrews 12:10 They disciplined us for a little while as they thought best; but God disciplines us for our good, in order that we may share in his holiness.
When we step out of line, our parents or guardians step in to discipline us to try and stop us going off the rails again; but this only lasts a short while.
The older we become, the less our parents get involved and the more we have to fend for ourselves and try to stay within the law.
But all this time, God is watching over us and trying to guide us in His ways which are the best ways for us – how much we listen and obey shapes our lives!