Waswas can have a number of causes. Sometimes it is controllable by the person, and a person needs to stay focused, needs to ignore it and carry on. This type of OCD is treatable, and our hadiths indicate that it’s influenced by Satan. There are also prayers that help with it. But sometimes it’s a complete mental disorder that the person cannot control. It’s a type of mental illness. If it’s to this severity, then Allah won’t hold this person accountable. Such people will either be forgiven in the Hereafter or they might be retested.