The Indian tour wasn't good either and felt like a big letdown. Against 2 strong opponents (Aus and Ind), he picked only 15 wickets in the last 8 matches.
He restricted himself to test format only as he played his last ODI in 2015 and last T20I in 2009. I think he recognizes that he is no more suitable for international cricket and its right time to leave cricket before selectors dropped him for the squad. His last 2 tours might not be big success but he has a 21 years career that is full of success. Let's give him a good farewell on his retirement.
England's test planning revolves around the Ashes only and it plays a major role in their team selection. Management finally realized that Anderson won't feature in the next Ashes, which is scheduled in 2025 and they need to fill the gap by giving chances to other seamers and try out all the seaming options.