ext to Psalms 1, 23 & 100, this is surely the most familiar of all psalms, and rightly so. The context is not a secret. King David stole his neighbor's wife and then killed his neighbor in order to hide his own guilt. None of us would say that David deserved forgiveness or mercy, because he didn't. Then again, who does? In fact, "deserving mercy" or "deserving forgiveness" are really contradictions of terms anyway. But you understand David was guilty of one of the most glaringly wicked and obviously appalling offenses in the whole Biblical record. Yet, as awful as David's sin was, he still took his infraction to God and, we know, he received forgiveness.
That is not to say that there were no consequences whatsoever. David paid for his sin with the death of his son, and with many troubles in his family for the rest of his years, and beyond. But, the most significant damage that sin accomplishes is not the punishment which it brings upon the guilty one; the most significant consequence is the breaking off of our fellowship with God (which infractions effect). Amazingly, David was forgiven on the spot as soon as he admitted his guilt (2nd Samuel 12:13). Immediately his fellowship with God was restored and his life was preserved.