The past few PMs of the UK have resigned. Most recently Liz Truss, after 45 days. I assume that the reason was that she felt that she was failing at her job, and the pressure to succeed was causing her too much stress.
If I make an analogy to the private market, let's say that for some reason I was appointed to be the CEO of Microsoft. I would be a bad CEO, after all, I have none of the theoretical or practical knowledge for that. I could either resign, or wait for the end of my term (after, say, 4 years). If I wait it out, Microsoft would definitely take a hit. However, it is a big company with many knowledgeable VPs, so if I just don't show up to work, Microsoft would probably survive. However, during my tenure, I would earn a CEO's salary, get to use the CEO's car+driver and make use of all of the personal assistants. Not a bad life.
I don't know what benefits the UK's PM gets, but I assume quite a lot. So why not just be a (bad) PM until you are voted out, meanwhile taking full advantage of all of the perks?