Reward for good actions and punishment for bad ones rests entirely with God. The reward that one receives for good acts is not the natural consequence of those acts; it is rather due to the grace and benevolence of God and it is entirely up to Him to reward one or not. Likewise, punishment for evil deeds is not a natural and unalterable consequence of man's acts. God has full authority to punish man for his sin as well as to pardon him.
God's grace and mercy, however, are interrelated with His wisdom. Since He is wise, He does not use His power arbitrarily. Hence, whenever God rewards a man for his good acts, He does so because the good was done with purity of intention and for the sake of pleasing God. And if God refuses to accept an act of apparent goodness, He does so because that act had merely the form or appearance of goodness, and was not motivated by the desire to please God.
In the same way God punishes man for those sins which he commits with rebellious boldness, and which whet his appetite for more rather than lead him to repentance. Similarly, in His mercy God pardons those sins which are followed by genuine repentance and readiness on the part of the sinner to reform himself. There is no need for the criminal to despair of God's grace and mercy, no matter how great a criminal he is. Nor is there any reason for even the most rabid disbeliever to despair, provided he recognizes his error, repents of his disobedience and is ready to replace his former disobedience with obedience.