Whenever a trainer is victorious in a battle, both the trainer and the used pokemon will earn experience. However, pokemon experience is handled separately from trainer experience. Pokemon will earn experience according to the level of the pokemon they defeated, taking into account how many pokemon were involved in the fight. Trainers earn experience according to the level of the trainer they defeated. These will be considered separate encounters for the purpose of determining xp.
For example, Ash defeats Brock. Ash was a level 3 trainer and Brock was a level 4 trainer. Ash will recieve 1350 xp. Ash’s Pikachu was level 2 and Brock’s Geodude was level 2. Pikachu will recieve 600 xp.
As long as the opponent’s pokemon is ultimately defeated, pokemon still receive 1/2 xp for a battle that they participated in even if they fainted.
Pokemon will not be eligible for role-playing and milestone experience handed out at the end of each session (this is purely for trainers). However, up to half of this “extra” experience MAY be donated to pokemon if, and only if, they somehow assisted in the acquisition of said experience.
For example, for using his Onyx to serve as a temporary bridge so that the party can cross the dangerous ravine, Brock receives 300 experience points. If he so wishes, he could choose to only receive 150 points and have his Onyx receive the other 150 since he would not have earned the experience without Onyx’s help.