Its mid-summer and the heat is on. We’ve broken and set new records for heat this season, and there’s still more furnace-like temperatures headed our way in the next few days, if the weatherman is to be believed. I confess: I have my doubts about him, but he seems nice.

And it will come as little surprise to most of us that we’re not alone in being affected by the heat. Lots of plants and animals change their behavior in this fiery season, and of course, we’ve all found ourselves giving wide berths to the swarms of ants we see around town on our walks, boiling like miniature demons out of cracks in the pavement.

But why do ants do this? The answer is that, while necessity is the mother of invention for humans, for ants, necessity often means giving birth to a whole new mother. A new queen and a new colony, actually.

I spoke with Walter Nelson, horiculturalist at the Monroe County Cornell Cooperative Extension, about this strange phenomenon. Surprisingly, Walter points out that the ants we see swarming on sidewalks are in fact an entirely distinct species of ant: the pavement ant (Tetramorium caespitum), which prefers dry, well-aerated soils such as those commonly found under pavements and sidewalks.

The swarming behavior we see is actually a moving party: whereas the ants would normally be content to stay in their burrows most of the time, when the colony gets to big or cannot be supported by the environment, it splits off with a new queen to form an entirely new colony elsewhere. That would be why you see them – not simply swarming – but trailing off in a certain direction. It is very common to see these moving parties during the mid-summer months specifically because of the extended heat of summer:

“Dwindling resources,” says Nelson, “will cause the ants to move the kids away, as it were.”

By the way: if you were surprised to find that there was such a species of ants as “pavement ants,” that’s probably because this is the species we’re most likely to take for granted. The same pavement ants that are found on pavement cracks also find our own abodes perfectly habitable, and thus when we see swarming ants in our houses, this probably the species you’re seeing. The much bigger carpenter ants are also very common, but it would be difficult to confuse the two.

If you’re looking around for more of these swarms to show your kids, a word of warning: pavement ants do in fact bite. One bite might not be a big deal, but this is a swarm, remember: you’ll get lots of little fiery bits and in some cases, those bites can cause a nasty allergic reaction.