For the moment, all discipline seems painful rather than pleasant. However, later, it yields the peaceful fruit of righteousness to those who have been trained by it.
Nosh: The nature of God’s discipline is that the pain associated with discipline be instructive and train us to be better and more successful people. If we accept this discipline it will yield an understanding of right and wrong which will bring peace into our lives. The verse implies that a lack of discipline or a rejection of God’s training will lead to the opposite, which is a life with a lack of peace, and characterized with increasing disorder, stress and confusion.