As GNARGNAR says, the answer is generally “balance”
The idea behind full sus in the first place being that you could go over rougher terrain faster. Having more travel at one end than the other would not provide any particular benefits because of inability the shorter end to absorb the bump as well.
Unbalanced travel bikes have always existed though, and are becoming a bit more popular again. The thoughts behind a lot of these, are like as you say, a lot of people run hardtails with a 4 or 5 inch travel fork, so why do we need as much suspension on the back?
Well we don’t always, particularly if we want a lighter bike that sprints better. My XC full sus bike has shorter travel out back than up front, but then I like having long travel forks even on a hardtail. It also allows be to attack the DH’s a bit faster than I could on a shorter travel fork. But if it’s all out bump eating performance and balance you’re after, matched travel front and rear makes sense (and to that end my long travel full sus bike has matched travel within a few mm at least).