Actually there is legal precedent for an ex-spouse to get a percentage of their partner’s retirement based on the time they were actually married. Google ‘QDRO’ for more information.
Idea being that if two were married for, say, 20 years and one spouse stayed home to take care of the kids and then gets dumped, they sacrificed their livelihood for the good of the household and should have a stake in the retirement egg they supported the other in getting.
As an ex-Pension Administrator, I think this is fine...as long as its adjusted for the amount of time a couple were married.
if ... one spouse stayed home
In many cases “if” is not important.