It’s a common law rule dating from the 17th to 19th centuries
Known as the rule against perpetuities “that prevents people from using legal instruments (usually a deed or a will) to exert control over the ownership of private property for a time long beyond the lives of people living at the time the instrument was written.”
The rule has its origin in the Duke of Norfolk's Case of 1682. That case concerned Henry, 22nd Earl of Arundel, who had tried to create a shifting executory limitation so that some of his property would pass to his eldest son (who was mentally deficient) and then to his second son, and other property would pass to his second son, but then to his fourth son. The estate plan also included provisions for shifting property many generations later if certain conditions should occur.
When his second son, Henry, succeeded to his elder brother's property, he did not want to pass the other property to his younger brother, Charles. Charles sued to enforce his interest, and the court (in this instance, the House of Lords) held that such a shifting condition could not exist indefinitely. The judges believed that tying up property too long beyond the lives of people living at the time was wrong, although the exact period was not determined until another case, Cadell v. Palmer, 150 years later.
Historically, the rule was no longer than 21 years from the death of some person alive at the time the trust or estate was created. However, that person(s) must be limited and identifiable. Which led to the creation of Royal lives clauses. The descendants of British monarchs became popular because it’s easy to find out who they are, even many years after the fact, and that family tends to live a long time. Other popular choices, particularly in the United States, are the descendants of John D. Rockefeller or Joseph P. Kennedy.
This is often only one of the conditions for the end of the trust and becomes a “savings clause” to prevent violation of the rule if the other conditions are (or become) too far in the future.
The period has been changed or abolished by statute in many jurisdictions. For example, England and Wales has adopted a flat 125 year limit. As a state-based law, the United States is hugely variable.
For example, one of the businesses I run operates under a trust deed that says:
"The Vesting Date" means the first to occur of the following three dates namely:-
(i) Sixty years after the date of this Deed.
(ii) Twenty years after the date of the death of the last survivor of the lineal descendants of His late Majesty King George V born and living at the date hereof or,
(iii) The date (if any) which the Trustee shall in his discretion appoint as the distribution date of this settlement.
The deed was made in 1982, which partly explains its style and implicit sexism, but I suspect that the solicitor who drafted it has been using the clause about George V for a lot longer than that. As of today, there are 35 living people who fall into the definition, including Charles III (see if you can work out the others); since there are now less than 20 years to go until 60 years after the deed, the clause will never be relevant.
Another business operates under a deed made in 2022:
14.1 Termination date
The Trust shall be wound-up and terminate on the first to occur of:
a) the date which The Trustee with the written consent of the Leading Member Appointer determines; or
b) 80 years from the date of this deed unless a State law allows otherwise including South Australia.
Note that the reference to living people is gone. Also, note the specific reference to South Australia, a jurisdiction that has abolished the rule against perpetuities. So long as they don't change their law back, this trust is effectively perpetual. Finally, not how much easier this is to read and skips the implicit sexism; progress.
Why doesn’t it affect the property of ‘immortal’ entities like companies or governments?
Because, in theory, it isn’t dead people telling living people what they can do with the property.
While the organisation may be ‘eternal’ the people making decisions for that organisation aren’t - the directors and legislators/executives in charge today can decide what to do with the property. This includes having the capacity to rewrite the rules of the organisation. While it may be hard to change a company’s rules and very, very hard to change a country’s constitution, it isn’t impossible the way it is with a trust deed or a will.
Changing a deed or will too much can result in resettlemet; creating a new trust and usually crystalising tax obligations the delaying of which was often one of the motivations for the trust in the first place.