Understanding the structure of food webs, and the mechanisms that give rise to this structure, is one of the most challenging problems in ecology. We analyze from a statistical physics perspective the network structure of model food webs and of 15 community food webs from a variety of environments, including freshwater, marine, estuarine, and terrestrial environments. We perform a theoretical analysis of two recently proposed models for food webs, the niche model of R. J. Williams and N. D. Martinez and the nested-hierarchy model of M.-E Cattin et al. We find that the two models generate distributions of numbers of prey, predators, and links that are described by the same analytical expressions. Our analytical treatment reveals that a model's capacity to reproduce empirical data is principally determined by its ability to satisfy two conditions: (1) the species' niche values form a totally ordered set and (2) each species has a specific exponentially decaying probability of preying on a given fraction of the species with lower niche values. To test this hypothesis, we generalize the cascade model of J. E. Cohen and C. M. Newman so that it satisfies condition 2 and find that the new model is able to reproduce the properties of empirical food webs, validating our hypothesis. We use our analytical predictions as a guide to the analysis of 15 of the most complete empirical food webs available. We demonstrate that the quantitative unifying patterns that describe the properties of the food-web models considered earlier also describe the majority of the empirical webs considered. We find good agreement between the empirical data and the models for the average distance between species and the average clustering coefficient. Our results strongly support two hypotheses: first, that any model satisfying the two conditions we identify will accurately reproduce a number of the statistical properties of empirical food webs, and second, that the empirical distributions of number of prey and number of predators follow universal functional,forms that, without free parameters, match our analytical predictions.