The decline started in season nine and I'll explain why:
-Bill Oakley & Josh Weinstein were the showrunners in seasons seven and eight. They felt like the show was wrapping up and used that opportunity to make more experimental episodes. One of those episodes was "The Principal and the Pauper," which was made near the end of season eight but held back until the start of season nine. It's one of the most hated episodes of the entire series because of the reveal that Principal Skinner was an impostor. This episode wasn't supposed to be taken seriously, and it's not a bad episode by itself but it was the beginning of the show relying on nonsense and ridiculousness.
-Mike Scully became the showrunner in season nine. A lot of people blame him for the show's decline and while he did play a part in it, he wasn't the cause of it. Older writers were leaving, newer writers were coming in. This wasn't the first time it happened (most of the original writers left after season four), but the show couldn't adapt with the new writers and it slowly started losing what made it great. Jokes started going longer than they should, characters became simpler, and episodes started having non-endings, or strange endings.
-There weren't as many classic episodes as previous seasons. Classic moments, but not entire episodes. Some episodes were just okay, and others could be considered bad.
-Homer started taking over the show, to the point where it seemed like he was the only character the writers cared about. Characters who should know better started going to him for advice, he became more of an a$$hole, he started having less motivation for the things he did, and he started acting like he was entitled to whatever he wanted. He also started getting hurt all the time for no reason. A drawbridge closed on his head and he came out perfectly fine like an episode of Looney Tunes.
A lot of these problems got worse in season ten, but season nine was the first sign that things were different. It's like when you eat your favorite food and something's not right about it, but you can't figure out what it is.