All perfect praise be to Allah, The Lord of the Worlds. I testify that there is none worthy of worship except Allah, and that Muhammad is His slave and Messenger.
According to the majority of scholars, charity does not expiate major sins, and the Ahaadeeth on the expiation of sins are about the minor sins that are related to the Rights of Allah, The Exalted. As for the major sins, they necessitate repentance, and the repentance from sins that involve the rights of people require seeking the forgiveness of the wronged people.
The author of Daleel Al-Faaliheen said: “This applies to the minor sins that are related to the Rights of Allah, The Exalted. As for the major sins, according to the correct opinion, they are only expiated by repentance with its due conditions. As for the sins that infringe on people’s rights, they are only expiated by seeking forgiveness from the wronged people.” [End of quote]
The Hadeeth of the woman who gave water to the thirsty dog and then Allah forgave her was narrated on the authority of Abu Hurayrah, as a Marfoo' Hadeeth (directly attributed to the Prophet ), and it reads: “While a dog was going round a well about to die of thirst, a prostitute from the children of Israa’eel saw it and took off her shoe and filled it with water and gave it to the dog to drink. So Allah forgave her because of that deed.” [Al-Bukhari and Muslim]
The apparent meaning of this Hadeeth is that Allah, The Exalted, forgave her for that act which reflected her compassion and mercy. These qualities are among the reasons for obtaining the Mercy of Allah, The Exalted.
Al-Haafith Ibn Hajar said in Al-Fat-h: “The Hadeeth reading: ‘So Allah thanked him, so He forgave him,’ means that Allah, The Exalted, lauded, accepted, and rewarded him for his deed. The conjunction ‘so’ has an explanatory function. Al-Qurtubi said: ‘His saying, “So Allah thanked him” means that He manifested His reward for his act before His angels by admitting him to Paradise.’ Ibn Taymiyyah said, commenting on the story of this woman, ‘This reward was awarded to her because of the goodwill and mercy that were in her heart as she did that deed.’” [End of quote]
Allah Knows best.