The females in theses swarms are potential queens for new colonies. They will move away from the area to try to establish their own colony; once they have found somewhere, they will discard their wings because they are no longer necessary. Instead, they become an essential nutrient to get them through the initial stages of the new colony. Not many of these potential queens survive this period.
If they do, however, the colony will grow with the rearing of wingless, non-sexual mature worker ants. Once the colony is well-established, which will take a number of years, reproductive ants will be produced, and these winged ants will begin the cycle all over again.
Seeing flying ants can be a dramatic experience, but they do not pose any threats, either physical, or of increased ant infestation. They have come from colonies that already exist, and will either die or move away very quickly. In rare cases, they have been known to try and create a new colony in a building; the two species that may do this are Carpenter ants and Pharaoh ants.