I went to a friendly gym and battled the lowest player and won multiple times, enough to up the gym level and leave my Ratticate there. However his CP is still 313. I thought the purpose of friendly fighting was to increase CP for your pokemon. What am I missing?
Pokemon don’t gain CP at a gym. Successfully training at a gym raises only that gym’s “prestige,” and consequentially, the gym’s level.
The only way to increase the CP of your Pokemon is by using Stardust to power them up or evolve them.
The purpose of a gym is to put a Pokemon on it to defend it which can earn you 10 gold coins each (max 100) per 21 hours. You can collect them in the shop at the right top. This can be done straight after or you can wait.
Source : Link , Question Author : user2441387 , Answer Author : Eikre