First of all, there is nothing like that in Quran that our holy prophet(pbuh) came under the influence of some sort of magic. The two surahs are prayers to seek protection of Allah the almighty from different sorts of ill effects and people who plan and do ill to hurt others