One question before we go on
Someone tells you that during prayer a blasphemous sentence appeared in their head and would not leave. Which of these is closest to the truth?
Part of them must believe itTheir faith is weakeningIt arrived on its own, and their horror at it is the more telling factThey need to repeat the prayer until it stops
Not quite
The horror is the tell. Somebody who did not care would not be distressed. That is close to what the Prophet, peace be upon him, said to the Companions who brought him the same thing, and it is what the research finds too. Unwanted intrusive thoughts are nearly universal. What differs between people is not whether they get them, but what they conclude about having them.