Should a PC get XP for assisting outside of combat?

Related, but about a PC not participating at all in a combat: Do people get XP for battles they weren't in?

Generally, experience points for a combat encounter are divided equally among the participants.

If a PC does not participate directly in a combat, but significantly contributes to the success of the party in another way, should they count as part of the combat party for the purposes of awarding XP?

For example:

  • A PC scouts out the party that the PC’s are planning to attack and relays back essential intelligence that allows the rest of the PC’s to win the combat, but then the scout PC goes on another scouting mission or does something else rather than join the actual fight.
  • A PC provides equipment, buffs, money, logistical support, diversionary tactics, or other resources to those who end up participating in the combat, but withdraws before the first round of “combat” begins. For example, a PC turns themselves in to the Town Guard and confesses to an offense. While the Town Guard is occupied in processing the PC into jail, the rest of his party attacks Town Hall.

Are these kinds of PC’s actually considered participants in the combat, even though they did not actually swing a weapon, cast an offensive spell, etc.? That is, these are PC’s that contributed, but did not specifically have any “combat rounds” where they had opportunities to take combat actions, roll dice, be wounded, etc.

If whether these roles count for XP is dependent on criteria, what differentiates an XP-worthy support role versus a non-XP-worthy support role? Could it, as @NautArch alluded to, involve whether the support PC risks their life or endures a substantial risk of being drawn into a literal round of combat (even though they successfully avoid it)? It would be more plausible, I think, to award XP to a PC who pilots a scout balloon over enemy territory and risks being shot at (even though he ends up not being shot at because the enemy does not see him as a sufficient threat because reasons), than it would be to award it to a PC who stays at home and casts buff spells on those going out.

The real life equivalents of the characters that I’m talking about here are essential elements of any real-life military, militia, or law-enforcement group – they are the drivers, transport pilots, dispatchers, mechanics, radio operators, cargo loaders, intelligence analysts, scouts, code breakers, etc. who enable the literal people on the ground with the weapons to accomplish their job.