I hate changing jobs and have only done it 4 times in 30 years.
The first was for a better opportunity as I felt the technology where I was would not be good for long term future prospects. What really started me looking was my second annual evaluations in a row by my manager that rated me as average even though I was doing the same work and quality as "senior" people that had been there 5 years. It was a great decision.
The second was partially involuntary. I could have stayed if I wanted to uproot my family and relocate half way across the country to a less desirable market for the software industry. That was a "I'll take your severance package and good luck" obvious decision. That turned out to be a great decision to change jobs as well.
The third I enjoyed the company but certain people, particularly HR/Admin staff drove me away. The straw was nit picking working hours and treating me like an hourly employee even though I was exempt. For example, I attended a trade show Thur-Sun and didn't get home until late Sunday night. The office manager told me I needed to take 1/2 vacation day because I didn't show up until noon on Monday (after being gone and working all day Saturday and Sunday). She complained if anyone took a 2 hour lunch break to go to a doctor's office regardless of the fact that they had worked 60 hours the previous week. I decided if that was how they were going to treat people that I was not going to put up with that and left. That turned out to be a great decision.
The last one was very recent and I haven't been at the new place long enough to know if this was a great decision or not.