You enter a food term and choose a nutrient and a direction. The tool takes the first 15 matches USDA FoodData Central returns for that term from its generic datasets, loads each full record, and sorts them by the chosen nutrient per 100 g, highest or lowest first. Eleven nutrients are available, from protein and calories to sodium, fiber, calcium, iron and potassium.
This is a ranking of those 15 records, not of the whole database. Which 15 you get depends on how the search orders results for your wording, so "beans", "dry beans" and "canned beans" produce different pools and therefore different winners. Branded products are not included.