In 1966 the US Department of Agriculture (USDA) established Standards for Grades of Slaughter Cattle and Standards for Grades of Carcass Beef that created uniform categories in quality and composition for different types of beef. This allowed consumers to know what they were getting and beef producers/packers to know how to price the carcass.
At the packing plant it is voluntary for the beef to be graded by a USDA Inspector and the plant pays a fee for that service but in the great majority of cases it is done today. Although there is a very technical description of the various categories the reality is the Inspector grades visually based on years of experience.
Quality grading is based on marbling (the amount and distribution of intramuscular fat) and physiological maturity (age). Younger is better as is more marbling. There are actually eight different quality grading standards – although consumers probably only deal directly with the first three.
In order of declining quality:
USDA Prime
USDA Choice
USDA Select
USDA Standard
USDA Commercial
USDA Utility
USDA Cutter
USDA Canner
There is also a type of grading called yield grading that is much less well known. This is an estimate of the relative amount of lean, edible meat from the carcass. With more consumers interested in lean beef this becomes an important marketing factor.
In order of declining yield (grade 1 is the leanest):
USDA Yield Grade 1
USDA Yield Grade 2
USDA Yield Grade 3
USDA Yield Grade 4
USDA Yield Grade 5
If you want all the details there is a good paper HERE.