Introduction
As we see in the Book of Samuel, God's blessing is often related to our faithfulness and obedience. In fact, many promises in the Scriptures are conditioned upon our faithfulness. (If we do such and such a thing, God will fulfill a certain promise.) However, God's love and blessing is not based on our merit, like a mathematical formula (the more I obey, the more I will be blessed). God is free to bless us whenever He chooses, in spite of our imperfect obedience. His blessing is based fundamentally on His grace.
It's not hard to find illustrations of this in the Bible. For example, Abraham, Moses and David were sinners, but by His grace, God still blessed them and allowed them to be leaders of His people. Jacob was not blessed because he was more righteous than Esau. In fact, all through the history of God's people, we see that they have been unfaithful, but God still blesses them in many ways.