I feel like it is not just age, because Ancelotti told Kroos that he has a place in the team if he decides to come back on his word and not retire. I think it's more about talent and what you can provide for the team, Modric is older, and he still has one more year at Real Madrid, he is going to be something like 38, and still play there anyway.
Of course we have seen Modric be a lot more bench player than he used to be, so he is not going to play a ton of minutes, but at the end he is still there to provide something at the last 20-30 minutes of the games when they are having trouble. Aside from that, they have a very strong midfield and offensive line, so they do not need any players that would help them at that position any further.
Senior players at Real Madrid have shared places with young players even since this season. We have seen Ancelotti rotate players several times and give many young players the opportunity to appear early or substitute for senior players in the second half. This is a strategy that Real Madrid has implemented well, so it allows them to regenerate well too.
You are right, it's not about age, because when Toni Kroos decided to retire it wasn't because he no longer had a place at Real Madrid. In fact, I am sure that he will remain part of Real Madrid for at least one more season. However, he prefers to commit to what he has said before. Yes, he once said that he would retire when he was at the peak of his career and when he was getting everything. And this season he got everything with Real Madrid who successfully won La Liga and the Champions League. So he was very happy when he ended his career at the peak of his glory as a player.