What do supervisors have to gain from a success or failure of a PhD student? I'm finishing a really messed up dissertation. Maybe decent in some sense, but all the PhD has been done without following any of the supposed methodology and criteria. Since I'm in a sort of arm wrestling with the supervisor from years and since I didn't miss the chance of exposing some soft versions of my PhD nightmare, I think that my supervisor might act in the following ways:


Helping to actually finish successfully the PhD so that all the issues will be silenced and hidden under a carpet. This might imply inviting examiners that are under his influence and pretending that everything is alright.
Otherwise, he might bring me to the viva knowing that the research cannot be accepted and exposing all its shortcomings.


This last one would open to two possibilities:


Asking the changes that he expected from the beginning of my research (independently from their actual value)
Making me failed so that I can take all the blame without having any chance to expose his responsibilities and delegitimize any possible retaliation I can do


I have the feeling that the only thing he wants to avoid is that I leave the PhD, because in that case he is powerless over me and I can actually expose the problems that occurred and ruin his reputation.

For this reason I'm trying to understand what is on the stake for the supervisor if I succeed, if I fail or if I abandon. I would like to know how this might affect his reputation and/or his role in the institution, or if any of these options would not change much (in positive or negative) for him.

I'm asking this, also for another reason: in any case and at any moment, I never perceived that my supervisor expected or had any interest in having me doing a great job. I have the feeling that this doesn't really matter to him. The only thing that matters is the utility that this research can have for his personal, social, institutional purposes.
First, to answer the question directly, supervisors have much more to gain from successful students than unsuccessful ones. Among other things, success brings them new students and future collaborators. Most of us are very proud of our successful students and, we hope, they have good feelings toward us, as well. The failures just disappear. 

Moreover, I doubt that he would want to keep you "under his thumb" rather than letting you go, whether from passing or failing. I think that it is very unlikely that any student, no matter how badly treated, can "ruin the reputation" of their advisor unless there is a pattern of abuse over many years and many students. I'm sure it happens, but is so unlikely that it would be an extreme event if he considered it to be a possibility. 

But, it is also possible that he just wants you gone, however it happens, because he sees you as a thorn in his side and he is tired of dealing with it. It is possible that, while failing you is a poor alternative, he sees it as the only way. That doesn't imply that he is correct, though he may be, and that you are wrong. But it might just be more peaceful without you. Your statement "all the PhD has been done without following any of the supposed methodology and criteria" is a bit of a red flag. 

I worry, however, that you may be fighting him just for the sake of fighting. He seems to have "expected" some changes. It seems you have resisted. I can't judge the case, of course, but it is a poor strategy to fight with your supervisor rather than seeking some accommodation. 

I don't know what options are open to you, but most seem dire unless you find a way to make peace. Abandoning years of work is difficult, but may be necessary if it hasn't been productive. Even established researchers have to do that on occasion.