Approximately constant ratios between numbers of predator and non-predator (`prey') species have been observed in both community and food web data. However, only a limited set of explanations for the pattern have been considered, and interpretation is complicated by the non-equivalence of the two data types. Analysis of predator-prey ratios for a large and heterogeneous set of community data, drawn from freshwater, marine and terrestrial systems, shows that predator richness is almost, though not exactly, proportional to prey richness across and within habitats, with some suggestion that ratios differ between habitat types. Three existing, and two new, explanations for this result are considered: random draw (influence of the species pool); prey niches (more prey types provide more niches for predators); enemyfree space (the number of prey coexisting with a predator is limited by apparent competition); energy ratios (richness is proportional to available energy at each trophic level); and common determinants of diversity (factors influencing diversity act similarly on predators and prey). Separating these is not straightforward, but the latter two hypotheses have high generality, and component parts of each are supported by available evidence. We suggest that a hierarchy of processes, each of predominant importance at different scales from patches to regions, produces the observed pattern of predator-prey ratios and that, in view of these explanations, predator-prey ratios should be considered as a special case of the general problem of guild structure.