Khaybar was manned by Jewish tribes that had previously reacted treasonously against the Muslims and had been exiled from Medina in turn.
They had already attacked the Muslims once, by participating in the Battle of Khandak, and Prophet Muhammad received intel that those Jewish tribes were again planning to ally with another pagan tribes to attack Medina.
The Prophet again attempted a diplomatic outreach to the tribes in Khaybar, but it fell on deaf ears. Realizing that the Jews at Khaybar were determined to march against Mecca yet again, Prophet Muhammad prepared to strike against them first.
Lecture notes available at http://www.why-quran.org/?p=635.
Subscribe at http://www.why-quran.org/subscribe to watch the lectures live and participate in the Q&A at the end of each class.
Video recording of this lecture + Q&A available on YouTube at https://www.youtube.com/watch?v=gBqMqgP0ERk&list=PLpkB0iwLgfTat-Pgh4W3WFmupPamiC9UT.