I think decline coincided with Disney Plus starting. Spread themselves too thin making mediocre content for the streaming service in the early days. Hopefully they have learned their lesson.
A lot of factors have been at play really; people like the Russo brothers, Downey Jr and Evans moving on, too many shows, excessive interconnectivity between it all, a steep decline in writing quality, a lot of pandering to activist types, a lack of stakes due to the multiverse, and possibly superhero fatigue (though I think that last one is a red herring). They also seem to have fallen into the trap that DC did of demanding excessive rewrites and reshoots late on in production.
With so many shows and movies in production simultaneously it's very difficult to pivot without losing hundreds of millions but hopefully the next batch of stuff is much higher quality.