Assuming that God runs the world and that nothing happens by chance, what is the purpose of anti-semitism?
This has followed the jewish people since their inception in Egypt and is very much alive and kicking today.
Antisemitism is in many cases viewed as a waking call for the Jews to return to the path of the Tora or else...
It is also sometimes viewed as a means of punishment after warnings have been ignored or after a great wrong doing An explicit example of that is Hadad HaEdomi which the Book of kings explicitely states : "וַיָּקֶם יְקוָק שָׂטָן לִשְׁלֹמֹה אֵת הֲדַד הָאֲדֹמִי מִזֶּרַע הַמֶּלֶךְ הוּא בֶּאֱדוֹם" (Melachim A, 11, 14). This shows that the lord can, at times decide to strengthen the enemies of Israel so much so that the Gemara in Sanhedrin (104, 2nd page) interperts the phrase in the Book of Lamentations (1, 5 - "היו צריה לראש ") thus: "any harasser to Yisrael becomes a ruler" ("אמר רבא אמר רבי יוחנן כל המיצר לישראל נעשה ראש"), and in the Gemara there is is clearly stated that it is a punishment for our deeds.
Also, you have referenced "their inception in Egypt" in the question - it's interesting to note the special Antisemitic activity around Pesach, which is a symbol of the formation of the nation of Israel