Its actually an interesting question. Pastors (canon 538 §3) and bishops (canon 401 §1) must submit their resignation at age 75, though the resignation does not have to be accepted. Cardinals would fall under these rules since they are usually bishops (or in rare cases priests). A Cardinal may continue to vote in a Papal Conclave until he is 80.
The Pope is the Bishop of Rome and some might argue as such he should resign at 75 as well. However the Pope is not subject to canon law since he is its legislator and judge. So on mere technicality he does not have to resign since the canon does not apply to him. And, until current day, it was quite simply the long standing tradition that the Pope continues on in that role until his death.
We should also remember that the whole concept of “retirement” is a relatively new one. Throughout the overwhelming majority of the Church’s past 2000 years clergy mostly served in active roles until they were no longer physically capable of doing so.
There is no theological reason that Popes can’t resign/retire at a certain age, it just hasn’t been the tradition to do so and, unlike bishops and priests, there’s nothing that can force a Pope to do so. Whether a new tradition is starting we can only wait and see.