I know it is an unsatisfying answer, but it just happened to be this way.
For a fairly long time, Slavic languages didn't use to have a personal pronoun for the 3rd person. Instead, they used the demonstratives *и, *ꙗ, and *ѥ, which is where the forms like её and его come from.
Pretty early on, the nominative forms of these pronouns got replaced (suppletion) by the nominative forms of another set of demonstratives: онъ, она, оно.
As time went on, these combined forms became personal pronouns for the 3rd person, which, funnily enough, resulted in the formation of a completely new system of demonstratives like тот and этот.
Now, as you may expect, possession also used to have only 1st and 2nd person pronouns. If you wanted to refer to the possession by a third person, you would simply use an adjective like сестрин (sister's) or restructure your entire phrase.
This is why мой and твой decline like that, in a very adjectival way (compare "мой" to "голубой").
With the 3rd person getting its pronouns, the possession also needed to change. But there wasn't really a form to handle it. So the genitive of 3rd person pronoun was used instead, but it can't change with the cases anymore since it has to be in a genitive case to show possession.
So that is why 1st and 2nd person possessives decline differently from 3rd person ones.
However, there is an interesting process that started back in medieval times and was subsequently fought by the Soviet reforms with questionable results. You see, you are not the only person who found the need to have a 3rd person possessive that shows what case it is in.
It seems that for the last 500 years or so, the language tried to fill the void by doing the only obvious thing: grabbing the existing 3rd person possessive and slamming an adjectival ending on it.
All the way back in XVII century, there was already significant use of the form ихний (their). Over the years, you will also see forms like егоный/евоный, еёный/ейный pop up here and there. These are always considered extremely wrong and extremely colloquial by the school system, yet they just keep showing up.
If you are interested in these kinds of topics, I recommend picking up a copy of "Историческая грамматика русского языка" by В. Иванов.