Swarms, like all other Celestial Objects and NPC Planets, are divided between 4 levels. Each level has a chance for a higher yield of Nanites when a Fleet is sent to harvest them. As the level of the Swarms increase, there is a higher chance for your fleet to be ambushed and attacked. It is recommended that for the higher levels of Swarms one encounters, one brings fleets of increased size due to the heightened threat of your fleet being destroyed in an ambush.
When a fleet is sent to a high-level swarm, there is a small chance that the fleet in question will have found a 'Super Swarm.' Super swarms are different than regular swarms because they give an incredibly high yield if enough attack/cargo ships were present.
However, there is also the threat that the Nanites in the swarm will attack and destroy 10% of your ships.