Chances are it happened at your house as industry is under strict requirements when it comes to pest infestation and control. All the large manufactures/suppliers are audited by AIB or some other certification body (SQF/BRC/ISO) and pest activity in packaged/processed product would result in failure and/or pulling of their certification. If the supplier expects to sell in the largest grocer in the US (Walmart) they have to have at least a GFSI certification.
All that said it occurred either at the grocery store (highly unlikely) or your residence.
In my case I think this is happening in bulk stuff, i.e. I scoop personally from bins into plastic bags they supply, I write the item number on the twist tie (it's wide at one end) and they weigh at the checkout counter and charge me accordingly. So, their bins are exposed. Is it conceivable that contamination happened in the store? I think so. Like I said, I just don't know how those bugs got into that stuff, I've had it happen before, so I try to make a habit of tossing the bags into the freezer for a few days before emptying the contents into tightly closed containers, prefereably jars.
Do all the bugs die when the outside temperature hit -20F degrees? No it does not. Most freezers hover around 0F degrees.
As does mine.