I've observed that a swarm of bees that will leave a hive have already decided on a new home site. Bees that remain in a hive have settled temporarily to finish selecting a site. In the 1st instance the swarm is just gathering itself, checking for the presence of the queen, and catching its breath before taking off again. Such a swarm will even leave a frame of honey and/or brood placed in the hive as an anchor and the only way of keeping such a swarm is by using an excluder as an includer, to keep the queen inside the hive. Om tje 2nd instance they will usually accept the offered home unless they find it objectionable for some reason. Those reasons can include, but are not limited to, plastic smelling frames, odor or paint thinner or other chemicals in or on the hive, too small of space (trying to catch a 5 lb swarm in a medium nuc box), or the scout bees return and convince everybody the site they've found is better.