Pantry pests can vary but you will know you have them if you experience moths coming out of your kitchen cabinets, notice cream colored worms crawling up the walls in the pantry or kitchen or see a variety of small beetles/weevils in a grain or food product. While there are several different kinds of pantry pests note that they were likely brought home in food that you purchase. They are more commonly found in natural less processed foods like wheat flour, nuts or dry pet food.
It is likely that you purchased the product, stored it and over time the conditions were conducive to these pests growing and moving beyond the infested product package.
You must find the source (it will be obvious) and give the pantry a good cleaning including all of the cracks and crevices. Be sure to immediately throw out the infested food along with any other food that you feel may have been contaminated. Inspecting food before leaving the grocery store is one means of prevention, however, it is not always realistic.