But I think the biggest thing is that programming is a craft, and many programmers think of themselves as artists. As an artist it is heartbreaking to see your creations tainted and then discarded by corporate politics.
In my experience, devs who take more pride in closing tickets than coming up with elegant solutions are less susceptible to burn out. I don’t know exactly how they do it, but they do tend to have many hobbies. They don’t lose sleep over shipping some spaghetti code they copied from stack overflow without understanding. They just treat it as something to get out of their way so they can get to the things they actually enjoy.