Swarming is the natural process by which a honeybee colony can reproduce itself.
In late Spring, usually during a nectar flow, when the colony is prosperous, the worker bees start to rear replacement queens. Larvae are selected at a very early stage of development and reared exclusively on royal jelly which a very rich secretion from the hypopharangeal glands of nurse bees.
This diet of royal jelly alone, is responsible for turning the course of development of a worker bee larva into a prospective queen (an epigenetic effect). The wax cell in which the larva is raised is enlarged and converted from the usual upright orientation on the comb, into a downward pointing peanut-shaped cell.
If the swarm is as easy to collect as this one was, a beekeeper will be pleased to collect the swarm and add it to an empty box. Swarms can sometimes harbour disease so not all beekeepers would welcome such an addition to their apiary.