Grace and Discipline

How does discipline fit with the grace of God?