” It is a maxim of every prudent master of a family, never to attempt to make at home what it will cost him more to make than to buy.”
This is tied to the concept of comparative advantage and gains from specialization and trade, which lead to an increase in the size of the ‘economic pie’ which can be used to make everyone better off.
What about eating local?
Who has the lower opportunity cost of producing food- you, your neighbor, or produce farmers in California?
The following post from the Marginal Revolution economics blog addresses eating local and the relationship between food miles and your ‘carbon footprint.’
Is there a tradeoff between how ‘local’ your food is and your impact on the environment?
Some say yes , but there is much debate about that issue, as you may find in the blog link or here in National Geographic.
Actual research related to this issue can be found here