Source: Pathfinder 2e Gamemastery Guide
Transcription:
A screenshot of plain text, reading:
The Experience Points gained for besting an NPC depend on how the party overcame them, because XP comes from overcoming a specific challenge. If the PCs defeat the NPC in a non-combat setting of the NPC’s specialty, the party gets XP based on the NPC’s non-combat level. If they just beat the NPC up, the XP would be based on the NPC’s creature level. Quite often, that means 0 XP and failure at the PCs’ objective; for instance, during a baking contest, if the PCs murder the other baker, not only would they be disqualified, but the would likely be apprehended for their crime.
This is the kind of thing that makes me want to switch from 5E to PF.