Or food products that contain a label "Not for resale"... I know a lot of Costco products have this because they sell large quantities, but how is that actually enforced?
There are labelling requirement for sale of food. A product you buy in a multipack at Costco marked, usually, “not labelled for individual sale” just means that the manufacturer has not provided the mandated labeling on the individual packages, so that commercial resale of those individual packages as-is would violate the law.
I would imagine that's different because you have to be a member to buy it. Presumably if they find out that you are selling individual items from a larger set they'll revoke your membership.
It happens in non-member based stores as well, e.g. Kroger has labels on formula asking anyone that sees it for sell elsewhere to call a number. I assume they just do the legal bullying thing as those reselling often probably can't afford the fight.
Quite strange it appears on this large item and not on hardly any other item in the store, especially those that are easier to shoplift. I believe it is to prevent those using government baby formula subsidies from reselling.
Edit: after reading online, I think you are probably right but it seems like a dumb deterrent and inconsistently applied.
It has nothing to do with shoplifting. The seller and manufacturer don't care whether you resell the items, but the Government does. In the U.S., the FDA requires that all packaged food products sold at retail contain a Nutrition Facts label. Multi-packs often don't have Nutrition Facts printed on each component wrapper, and so cannot legally be sold under law. In fact, they are required to have "This unit not labeled for retail sale" printed in such cases.