So, normally treasure and xp are divided up upon return to civilization.
What happens if the party splits and someone leaves early?
A hireling was killed and raised in a recent dungeon. Rather than quit their exploring, one of the party members flew her invisibly out of the dungeon to their mercenary camp to recover. Since they ate deep in the jungle I have called the merc camp ‘civilization’ but this could easily happen in dungeon under a city or whatever.
So…what to do? She participated for three levels of the dungeon, so she ought to get something when the rest of the part returns. But how do you determine what she gets exactly?
For combat XP, I do it based on who was involved in each fight. This doesn’t even need to be “going home early” - if you’re unconscious or hiding out three rooms back, well clear of the fight, then no XP because you’re not a part of it. (Note that hiding in a corner in the same room is fine and you still get XP. Even if you’re not actively participating, at least you’re there and able to observe, if nothing else.)
For treasure XP, I wouldn’t consider the merc camp to be “civilization”, unless it’s a permanent camp and large enough to sell some of the loot there. If it isn’t, then they need to figure out how to haul it all back to real civilization, with all the logistical issues, potential danger, and chance for some to be lost or stolen along the way which that entails. Coincidentally, this also resolves your issue with players leaving a session early, since it means that everyone involved in the expedition gets loot XP, even if they missed part (or all) of some sessions.
Note also that some groups award treasure XP to each character based on the actual amount of treasure that character receives - if the party decides that the character who left early gets 500gp of loot while the rest of them keep 15000gp each, then the one character gets 500 XP and the others each get 15000 XP. While this also addresses your issue (by making it the players’ problem to decide how they want to divide the loot), I personally prefer an even division of XP (even if cash division is uneven) because it’s more resistant to manipulation for purely out-of-character reasons. (e.g., “Enea will come up 70 XP short of level 5, so the rest of us will each give up 20 gp from our share of the loot so she gets the extra 80 XP and levels this week instead of next week.”)