XP is normally divided equally between all participants, which normally means the whole party (or at least the whole party that was present and involved).
At times you may decided that this is not fair usually because a player deliberately chose not to be involved in the encounter in order to avoid risk. This typically happens when exploring when one player decides to always hang back and let other players take any damage. If a player doesn't get attacked, doesn't attack anything, doesn't contribute a buff or a debuff, and doesn't help patch up any wounds, then it would be fair to exclude that player from experience. Occasionally you'll get in situations where one player acts as the scout for the rest of the party - usually either a party 'tank' that is hard to kill, or the party rogue that is hard to detect. If that character wins a fight before anyone else can participate, or disarms a trap (even by setting it off) when no one else is taking any risk, then award full XP to that one PC.
But if the party is sharing in the risk, then they equally share in the reward.
Another slight exception, and I don't know if this is in the official rules of 3e but it was in 1e and so I still follow it, is that NPCs in the part get only a 1/2 share of XP for participating. This is presumably because they are just taking instructions rather than showing any initiative of their own. The way I usually calculate this is add 2 for each PC and 1 for each NPC to calculate the number of shares, then divide the XP by the number of shares, and then give 2 shares to each PC. In this way, a PC's henchmen if they are kept alive slowly become more useful, without being a huge drain on the parties advancement. It also tends to discourage parties from bringing in a cumbersome amount of henchmen, since the PC's share of the XP then becomes too small.