A single job created in large factories overseas often costs tens or sometimes hundreds of thousands of dollars. But small businesses are more efficient because they use fewer material resources and more labor.
So if you buy baked goods manufactured by a huge company with centralized production facilities, the price of the item pays mostly for the fossil fuel and materials used to run the machinery baking the item.
But if you buy the same item from a local bakery, the cost of the item is mostly paying for the labor used to make it. Overall, the cost to the environment is a lot lower.