I studied and compared life histories and dispersal patterns of two populations of green (red-billed) woodhoopoes Phoeniculus purpureus, occupying different habitats (with widely different vegetation, topography and climate), over a period of eight years (258 "flock years") in the eastern Cape Province, South Africa. The birds are obligate cavity-roosters, and I performed an experiment in which several woodhoopoe territories were established after the introduction of artificial roost sites in an area which previously supported no woodhoopoes. The evidence supports the hypothesis that roost cavities are critical in determining the limits to woodhoopoe distribution. Group size, dispersal frequency and dispersal distance differed significantly between the two study sites. I suggest that where cavities are in short supply and unevenly distributed, long-distance scouting forays are undertaken at a high probability of not finding a safe roost site to sleep in. This may result in an increased probability of predation, or physiological conditions with which an individual in poor body condition cannot cope. I propose that among woodhoopoes a stay-and-foray dispersal strategy is preferred to a depart-and-search strategy for a number of reasons. First, there is no within-group competition for limiting resources, since roost cavities do not provide a situation in which within-group conflict could arise. Second, I show that competition for breeding vacancies is more severe at the inland than at the coastal site, further borne out by the fact that, compared to coastal birds, inland ones are proportionally more likely to attain breeding status in the natal group than elsewhere. Finally, I propose that such environmentally-induced differential dispersal patterns between the two study sites have indirectly affected the frequency with which apparent inbreeding occurs, and I suggest that since incestuous pairings are relatively common, the either have no deleterious consequences for breeder fitness, or the potential costs of inbreeding are counterbalanced by the risks associated with dispersal.