Ka’b ibn al-Ashraf was one of the chiefs of the Banu Nadir, one of two major Jewish tribes left in Medina after Muhammad had expelled the Qaynuqa in 624 CE. The Nadir had not responded to the Qaynuqa expulsion; they had long been rivals. The Arab peninsula was not Arab versus Jew in those days, or No Jews Allowed, but different Arab, Jewish, and Bedouin tribal alliances working in factions together. The Nadir were allied with the Qurayza Jews and Aws pagan Arabs.
Al-Ashraf went to Mecca following Muhammad’s success at the Battle of Badr to lament the Meccan losses, and urge them to reclaim their lost honor. He was a gifted poet and wrote eulogies to the fallen Quraysh who fought against the man his tribe may or may not have a non aggression treaty with. Muhammad certainly felt they did, and that these poems were a violation. Al-Ashraf also composed erotic poems about Muslim women, which were considered so obscene Muhammad ruled them a violation of the Constitution of Medina as well.
Muslim follower Muhammad ibn Maslama and four others volunteered to perform the assassination by deception. By convincing Al-Ashraf they had turned from Islam, they lured him from his fortress and murdered him in the moonlight “in spite of his vigorous resistance”. The Jews of the Nadir tribe had to know they were unprotected by the treaty at that point, that Muhammad was asserting his dominance over Medina. It was no longer an equal society. It was an Islamic society.
In March 625 Muhammad lost a key battle to the Meccans. The Jewish Nadir seized on this opportunity to challenge him as the leader of Medina. It brought them closer to his attention. In July of that year, Muhammad claimed to have had revelation of a plot to have him killed which some of the Nadir and nomadic tribes had agreed to. He besieged the Nadir for two weeks, cutting down and burning their palm trees, while they waited for help that never came.
Muhammad had already been to the Qurayza tribe and besieged them in order to secure a promise they would not come to the Nadir’s aid in their hour of need. The contract was not preserved but the reply from the Qurayza to the Aws, who notified them that their dear brothers the Nadir were in terrible danger, strongly implies the reason they won’t be sending any aid is because Muhammad asked them not to, and his army is rather scary.