"1) Give the food to family B.
"2) Take the food for family A and let family B fend for themselves.
"Be honest with yourself.
Kin selection, a part of the ToE, would predict that the actions of the two families would depend on how related those families felt they were. The relation does not have to be genetic but can be communal.
What did happen?
And indeed beyond kin selection complex societies, such as those formed by intelligent apes practice group selection. A group which co-operates is more likely to have individuals in that group survive to child-rearing age than a group whose individuals constantly adopt the most selfish strategy. Dawkins (in his real-science rather than pop-science guise) has worked on the math of such propositions. The "repeated prisoners dilemma" models such situations in game-theory.
Well.
The family WITH the food, ate it and went to bed fat and happy.
The family without, attacked them while they slept, and now are enjoying have their neighbors for dinner; often.