Children are sometimes swatted with a switch by their parents. When the switch makes contacts with the skin, it surely has strong sobering effects. There is a saying, "Bitter pills have blessed effects." It is painful when we are punished and scolded. But it leads us to engrave our wrongdoings on our hearts and helps us to turn from them. In much the same way God guides His children even with the 'punishment of rods' when they go outside of the truth and take the wrong way (Hebrews 12:5-6). It's because in His love He wants only to lead them to the way of eternal life and blessings.