Personally I always prefer when the rules of a system can stand alone and don't make too many assumptions about the setting. One of the biggest adjustments I had to make when migrating my group from D&D 5e to Pathfinder 2e is that Pathfinder makes far more assumptions about setting compared to D&D.
In Pathfinder there are certain classes and game mechanics which are very tightly coupled to the setting of Golarion, particularly for the Cleric and the Champion. I personally am not a big fan of "loose Pantheon" and "interventionist gods" in my fantasy and spent a lot of time on my own custom setting for D&D which I've been porting into Pathfinder.
It's surprising given how much better PF is in other ways that it tries to force its (IMO kinda dumb) setting on the game. Like Pathfinder Champions and Clerics literally say that you have to worship an individual god, not a Pantheon, and that your god directly gives you powers. Whereas D&D Clerics and Paladins just say that you need to dedicate yourself to an idea, and that the religion may or may not be involved. IMO this is much better as a setting-agnostic system.
I think part of the reason D&D wins out here despite the fact that Pathfinder is the (again IMO) better-designed system overall is that D&D has a legacy of multiple settings being used for its adventures, whereas my understanding is that PF has always used the same setting. So when WOTC was creating 5e they built in a certain degree of setting-agnosticism from the ground up.