Stores can't sell the food after the expiration date, which is why they usually mark it down as it nears expiration, but they can donate it. Same with the manufacturers. And with food pantry donations down everywhere most of what is donated is close to or past the expiration dates, so lots of what is handed out is already expired, quite normal. Remember, these are charitable organizations, they're trying to help, not obligated to.
While people won't necessarily get sick from eating expired food, its freshness and nutrient value may be diminished, but some of it is still edible, and probably considered more nutritious than nothing.
"Unprocessed" pantry foods - pastas (the mac and cheese), cereal, baking mixes, dry beans, grains (the brown rice), and nuts are safe to eat if they have been stored unopened, and these shelf stable foods should be good to eat indefinitely unless the packaging has been damaged.
"Processed" pantry foods are also considered shelf stable because they have either been heat treated (canned foods), are a dry formulation (cake and pudding mixes), or have reduced water content (dried foods, crackers). The quality should also be fine until opened unless there are cracks at the seams or they are bulging, signs of the Botulism bacteria.
And, are you aware that the only things federal law mandates be labeled with expiration dates are baby formula and some baby food items? Some states mandate including dairy items as well, but not all. All the others are voluntarily put there by the various manufacturers to help us.
I doubt your neighbors are giving you their older items, just items they've received and will not use. Knowing their needs they probably are just trying to help you out. Donate the items to your church food pantry box, with 1 in 5 American children going to bed hungry, they will be put to use.
http://www.thirdage.com/nutrition/food-expiration-dates-w...
http://www.webmd.com/food-recipes/guide/do-food-expiratio...
This site /\ lays out all the various labeling dates: expiration, sell by, use by, etc.
http://www.strength.org/childhood_hunger/?gclid=COyI1qzu8...