Hebrews was written to a group of people who were fading away in their walk toward salvation. They were going through some pretty difficult trials, but they were not facing up to them. The underlying theme here is chastening. Many modern translations will use the word "discipline," and technically, it is closer in meaning to the Greek word.
Discipline covers formal instruction, but it also includes drill. Drill is associated with learning something repetitively—over and over again till we get it.
Discipline also includes punishment: spanking, rebuke, stern correction. Paul is saying that the sons of God should expect correction and rebuke. God has a way of starting off easy, but the punishment, the rebuke, the discipline become more stern as we fail to respond until He finally gets our attention. This could go so far as the Tribulation.
God's discipline is always corrective. He is not a sadist; He does not discipline for the fun of it. He disciplines us because we need to be turned in another direction. He is removing impediments to our spiritual development, so we do not need to become discouraged.
John W. Ritenbaugh
What Is the Work of God Now? (Part 2)
Other Forerunner Commentary entries containing Hebrews 12:5:
1 John 4:8