After the Muslims lost the Battle of Uhud, the Muslims were treated differently by the Jewish and Arab tribes in Medina. The Jewish tribe of Banu Qaynuqa increased their hostility against the Muslims. They told Prophet Muhammad, peace be upon him when he came to remind them of their treaty not to be deceived over their victory in the Battle of Badr against the idol-worshippers of Quraish since they had little understanding of the art of war. They also added if the Muslims had fought them, they would see how war really was and how fierce of an enemy they were. They also broke the treaty with the Muslims by killing a Muslim in the marketplace. So, Prophet Muhammad, peace be upon him, ended the treaty with them and expelled them from the city by giving them three days to pack their stuff and leave.
Another Jewish tribe in Medina called Bani Nadhir also broke their treaty with the Muslims by attempting to kill Prophet Muhammad, peace be upon him, by asking him to sit in a particular place where they tried to drop a big piece of a wall of a fortress. But Angel Gabriel told Prophet Muhammad what they were plotting, and he got up. Prophet Muhammad had no other choice but to expel this Jewish Tribe from Medina as well for their evil actions and betrayal. Prophet Muhammad asked them to grab all their belongings and leave the city, which they did and moved to a neighboring city named Khaybar.