At the age of 38, of course Luka Modrić is no longer able to compete in playing in the top European leagues, so it is only fitting that Luka Modrić spends the rest of his career playing in the Saudi Arabian league to collect more money and also there the league is not competitive making him Luka Modrić can still compete in showing his performance, which is different if he stays at Real Madrid.
Real Madrid only needs Luka Modrić to be able to guide young players so that there is regeneration in the Real Madrid team and he has been doing this for the last few seasons until now it is time for Luka Modrić to leave, either retiring or continuing his career in a non-competitive league. I think it's the same, those are two good options.
We have the top clubs in La Liga this season. Real Madrid have reach far this season, is regarded as the best team in La Liga this season, they have the best performance and doing the ultimate work to reach important phases this season. Carlo Ancelotti knows the high class players he have in his team and he's really comfortable working with them. Luka Modric is one of the top players in Real Madrid and he have earned his place in the team. He's currently referred to as Real Madrid legend based on his contribution to the team's progress over these years.
Even at his age, Real Madrid has a tempo that carries the team and takes it forward. His peers have mostly quit football, but he still continues his outstanding performance at Real. Luka Modric is now a legend not only of Real Madrid, but also of football.