The social layer
Gyms & Teams
Three teams fight for the gyms on the map; the Pokémon you send in decide which team holds a gym, and the power-up layer is what makes the gym worth it.
Gyms are the spot on the map where the team layer lives. There are three teams, and each team fights for the gyms on their map. To hold a gym you send your Pokémon into it, and the Pokémon you send — their level, their IVs, their moves — is what decides whether the gym stays with your team or flips. A gym is a shared, team-based goal: the more players on your team who send strong Pokémon into it, the more secure it is.
→ The raid layer that a gym can also turn into→What's not coveredThe gym structure is the game's own. Which team is currently holding your local gyms, and how strong the defenders are, is live data — check the in-game map.