The date printed on a package looks official, and shoppers treat it as an expiration. For most foods sold in the United States it is a quality estimate set by the manufacturer.
Most dates are not federally required
Federal law requires dating only on infant formula, where nutrient content must be guaranteed through the labeled period.
Everything else is dated voluntarily, or under state rules that vary, which is why the phrasing and placement differ so much between products.
Because the practice is voluntary, the underlying testing and the meaning of the date are decided by each manufacturer rather than by a common standard.
The phrases mean different things
A best if used by date indicates when a product is expected to have its intended flavor and texture, not when it becomes unsafe.
A sell by date is an instruction to the retailer about stock rotation, telling the store how long to display an item while leaving reasonable time at home.
A use by date is closest to a safety date, and on infant formula it should be observed strictly.
Dates are set by testing under assumed conditions
Manufacturers determine shelf life by storing product and evaluating quality attributes over time under expected handling conditions.
Those assumptions include a refrigerator at a proper temperature and an unopened package, so real storage that departs from them changes the outcome.
Once a package is opened, the printed date stops applying, because the product's exposure to air and handling has changed.
Spoilage and pathogens are different problems
Spoilage organisms produce sour smells, slime and off flavors, and they are the signals people use to judge food, though they are not usually the dangerous ones.
Pathogens that cause illness often produce no detectable change, which is why appearance and smell cannot confirm safety on their own.
Handling temperature matters more than the printed date for these organisms, since growth depends on how long food sat in a warm range.
Confusion drives avoidable waste
Households discard substantial quantities of edible food because a quality date has passed, and industry groups have pushed to standardize on fewer phrases for that reason.
Food banks and retailers apply their own policies for accepting and distributing dated products, generally distinguishing quality dates from safety ones.
Anyone unsure about a specific product, particularly with a vulnerable household member, should follow the manufacturer's instructions or consult public health guidance rather than improvise.