At least, it was trial and error, until GamePress published an incredibly comprehensive list of all the best gym defenders and their toughest match-ups.
If you’ve ever wondered why most gyms seem to be defended by a Snorlax, a Dragonite or a Lapras, it’s because those three Pokemon have the fewest weaknesses that can be exploited. Charizard and Gyarados might be strong in the Game Boy games and the cartoon, but in Pokemon Go, they aren’t better defenders than certain other popular Fire-type and Water-type Pokemon.
It’s worth noting that this list isn’t as simple as “strong-stronger-strongest.” Although the strength of an individual Pokemon does play a strong role in its tier placement, GamePress has also taken into account the potential counters that a given player will have when he or she attempts to steal a gym from you.
You need to visit GamePress for detailed explanations of each and every defender on the tier list, but the graphic below is a great starting point: