All gyms have prestige , think of it like the health of a gym . Battling reduce the prestige and training increases it . Once the gym goes up a level a new spot is opened and you can add a pokemonWhen it goes down a level a spot is removed and the lowest Pokemon is kicked if its spot is goneIf the prestige is reduced to 0 the gym will become empty , and the person who beat the leader will have priority to add their Pokemon . Its actually not necessary to defeat the gym leader until the final fight , can if you want but not necessary , what you need to do is reduce the gyms prestige . In your case for batteling you will remove 1000 prestige per Pokemon defeated , and an extra 1000 if you beat all the Pokemon in the gym . If you beat a level 1 you will empty it out as you remove 2000 prestige which is the max for level 1 gym . For higher level gyms you need to beat it multiple times , a level 10 gym has 50 , 000 prestige so it will require multiple wins . Looking at your post your not getting sniped , your are just not removing enough prestige to clear the gym . If that ' s not clear let me know and will try explain more