Which is the better fantasy rpg and why: D&D 5e or Pathfinder 2e?
Neither.
5E is, at the end of the day, too simple - not enough crunch. New content is mostly just new subclasses that rehash the same abilities just in different configurations. Truly new mechanisms are minimal at best - the Arcane Archer is a good example. There still is no real Beastmaster Ranger, no Warlord that can give its full unrestricted action to others, and no Psionics. (Not as reskinned spells, not at all). You're getting milked, people.
PF2 on the other hand, is too restricted. Yes, it's crunchy. But most of it is empty crunch, since the devs have spent considerable energies on locking down the system. The joy of building a character (an out of game pastime) is almost absent. Juggling your actions at the table can still be fun, but a proper successor to 3.x/PF it is not. Then there are completely bewildering design choices - such as reusing some of the worst aspects of 4th Edition, a game Paizo's fortunes rest on by virtue of their customer base hating it. (I'll just say Talismans and leave it at that).
The unfortunate truth is that the game everybody wants, that is, a friendly accessible 5E with actually fun and powerful magic and items, yet one with deeper crunch, simply isn't on offer.
A game where advantage is replaced/supplemented by more granular bonuses, yet not the feats nightmare of PF2 (where most feats just shuffle around your existing values not actually giving you something nobody else could do).
A game like PF2 with a clear and defined magic economy (unlike 5E where gold is worthless), yet one with actually good and fantastical items that you want to loot or buy.
Monsters-wise PF2 win, hands down. So here I'll just say "a 5E game with PF2 monsters".
A game with actual balance designed by a strong team of good designers. Like WotCs or Paizo's. That is, obscure 3PP efforts doesn't count since these rarely if ever reach the balancing standards that D&D and Pathfinder strive for.