The Battle of Khandaq, which took place two years after the Battle of Uhud, is one of the important battles that had an important role in eliminating the barriers blocking the development of Islam. This occured in the year 629 between Muhammad and his followers against the Jews living in the oasis of Khaybar, located 150 kilometers (95 miles) from Medina in the north-western part of the Arabian peninsula, in modern-day Saudi Arabia.
Ahzab is another name for the Battle of Khandaq, which was given this name due to the trenches (khandaqs) dug around Madinah upon the order of the Messenger of God in order to stop the attack of the enemy easily.
The name Ahzab (groups) was given to the battle because along with he Qurayshi polytheists, Jews, Ghatafans and many other Arab tribes and groups came together in order to attack Madinah.
As it can be remembered, the Messenger of God had expelled Sons of Nadr, one of the Jewish tribes, from Madinah.
They had gone to the north and settled in important places like Khaybar, Damascus and Wadi’l-Qura.
They wanted to relieve the suffering they felt because of being expelled from Madinah by talking against the Prophet and Islam wherever they went and by provoking people against Muslims.
One of the incidents that Sons of Nadr Jews caused to happen through their provocation, encouragement and leading is the Battle fo Khandaq.
As, the Prophet had signed the treaty of Hudaybiyah with the Quraysh, he was not worried about the attack.
He wanted now to teach the Jews of Khyber a lesson they wont forget because they were continuously intriguing against the Muslims and trying to destroy them. Their last try was at the battle of the Trench when they stirred their allies of Ghatafan to side with them against the Muslims, even thought they didn’t fight at the battle, they still had an important hand in lighting it up. So the Prophet decided to put an end to all their tries and go to Khyber and bring it down.