Human law and divine law
From the book: The Gospel according to the Spirititism - Allan Kardec

Human law provides for certain offences and penalises them. The condemned person can therefore recognise that he suffers the consequence of what he has done. However, the law does not, and cannot, cover all offences. It represses more especially those that cause harm to society, but not those that only harm those who commit them. However, God wants the progress of all His creatures, and therefore He does not leave unpunished any deviation from the right path. There is not a single fault, however slight, not a single infraction of God's law, which does not have forced and unavoidable consequences, more or less annoying. Hence it follows that, in things of lesser significance as well as in important ones, man is always punished for where he sinned. The sufferings that result from his fault are a warning to him that he has done wrong. They serve him as an experience, they make him feel the difference between right and wrong, and the necessity of improving himself in order to avoid, in the future, that which has become for him a source of sorrow. Otherwise, he would have no reason to make amends. Confident of impunity, he would delay his advancement and, consequently, his future happiness.
But sometimes experience comes a little too late. When life has been wasted and disturbed, when strength has been weakened and evil has no remedy, a man exclaims: ‘If I had known at the beginning of life what I know now, how many false steps I would have avoided! If I had to start all over again, I would have conducted myself very differently. But there is no time left!’ Just as the lazy worker says, ‘I have lost the day,’ so he says, ‘I have lost my life.’ But just as for the labourer the sun rises the next day, and a new day begins which enables him to make up for lost time, so for man, after the night of the grave, the sun of a new life will shine, in which he can profit from the experience of the past and the wise decisions he has made for the future.