The Battle of the Ditch was an extension of the Battle of Uhud as the Battle of Uhud was an extension of the Battle of Badr. The Quraish suffered defeat at the Battle of Badr. Battle of Uhud was fought by the Quraish to take revenge of their defeat at the Battle of Badr. The Battle of Uhud proved to be indecisive. The Quraish were therefore, still suffering from the ignominy of their defeat at the Battle of Badr. The Quraish allied themselves with some Arab tribes of the desert and succeeded in mustering a force ten thousand strong.
"When a person dies, his works end, except for three: ongoing charity, knowledge that is benefited from, and a righteous child who prays for him."
Prophet Mohammed (PBUH)
"The best of what a man leaves behind are three: a righteous child who supplicates for him, ongoing charity the reward of which reaches him, and knowledge that is acted upon after him."
Sunan Ibn Mājah
"Every day two angels come down from Heaven and one of them says, 'O Allah! Compensate every person who spends in Your Cause,' and the other (angel) says, 'O Allah! Destroy every miser.'"
Sahih Bukhari