"Last year,
The Walking Dead TV show had another huge ratings drop, yet it still finished as
AMC’s most-watched TV series by a huge margin. "
https://tvseriesfinale.com/tv-show/walking-dead-season-nine-ratings/
That's what they do in Hollywood, milk their most successful project for every last penny. The fact that ratings are way off from when it the the #1 show on television has nothing to do with the fact that it still makes money.
Entertainment executives: "this show has run it's course, lets do the right thing and end it now leaving a bunch of cash on the table, or we could ride this into the ground with spinoffs and wring every last penny out of this franchise, let's do that."