The Juno mission observed that both poles of Jupiter have polar cyclones that are surrounded by a ring of circumpolar cyclones (CPCs). The north pole holds eight CPCs and the south pole possesses five, with both circumpolar rings positioned along latitude ~84° N/S. Here we explain the location, stability and number of the Jovian CPCs by establishing the primary forces that act on them, which develop because of vorticity gradients in the background of a cyclone. In the meridional direction, the background vorticity varies owing to the planetary sphericity and the presence of the polar cyclone. In the zonal direction, the vorticity varies by the presence of adjacent cyclones in the ring. Our analysis successfully predicts the latitude and number of circumpolar cyclones for both poles, according to the size and spin of the respective polar cyclone. Moreover, the analysis successfully predicts that Jupiter can hold circumpolar cyclones, whereas Saturn currently cannot. The match between the theory and observations implies that vortices in the polar regions of the giant planets are largely governed by barotropic dynamics, and that the movement of other vortices at high latitudes is also driven by interaction with the background vorticity.