The idea, in one sentence
The cost of doing something is not just what you spend — it is also whatever you gave up to do it.
A building can only make one thing at a time. If it is producing materials for you, it is not producing the thing it is best at. The profit it is not making is a real cost, even though no money leaves your account.
How it plays out
This is the trap in vertical integration. You need a material. You check: buying it costs $8 a unit, and making it costs you $5 in wages. Making it looks obviously better.
But the building making it could have been producing something that earns $100 an hour. If it makes 10 units of your material an hour, you are giving up $10 per unit of profit to save $3. Buying was cheaper by $7 a unit, and the accounts will never show you why.
Buy on the Exchange: $8.00/unit Make it yourself — cash cost: $5.00/unit Profit that building gives up: $100/hour ÷ 10 units = $10.00/unit True cost of making it: $5.00 + $10.00 = $15.00/unit Buying is cheaper by $7.00 a unit.
The same idea, everywhere else
Once you see it, it is in every decision. Cash sitting in your account earns nothing, so holding it has a cost. A building producing a low-margin product has a cost equal to the better product it is not making. Capital tied up in a slow-payback building is capital not funding a fast one.
The buy-or-build calculator on this site shows both the naive answer and the honest one side by side, because the gap between them is the whole lesson.