In the name of God, the All-Merciful, the Especially-Merciful
David was praying when two people suddenly entered into his presence. One of them said " This is my brother and he owns 99 sheep while I only own one. Yet he wants to take possession of my single sheep by force." In response David said " He would be doing you injustice if he takes your one sheep by force." David realized that what happened was a trial for him and he immediately sought God's forgiveness and fell into prostration and remembered God.
David didn't say anything wrong so why did he ask for God's forgiveness?
Maybe his repentance was because he realized the conflict was a trial with a slight delay. Small people make the biggest mistakes and are not worried the slightest. But David who is a perfect human begs forgiveness for realizing the conflict was a trial even though he was successful and gave the right response.
When God tests a servant, those who realize they are in trial are at a higher level of remembrance and their hearts are more attentive towards God. (Quran, Sad 21-25)
By: Seyed Alireza Mousavi