The popular reason pure software companies have great profit margins is for marginal investment in providing the product/service to more users, given software's replicability. That's the reason everyone likes to repeat.
The true reason is that they price similarly to physical goods companies, without the same recurring costs. The difference between physical raw material costs and total expenses which go into reproducing the product/service for each new additional user, which software coys do not have deal with, is what makes up "high software margins".
But pure software products/services shouldn't be priced like their counterparts with recurring costs. They have an abundance quality.
Software companies would probably argue with you if you questioned their pricing, given the relatively low marginal recurring costs they incur, probably throwing terms like "capturing the value you create" at you.
But that isn't how price works. Price isn't determined by value created. Nor is it determined by supply/demand.
So the trick has been pricing at similar rates as regular physical goods companies. At a closer look, one could decide that is wrong. Unlike what most people think, the price of a product/service isn't determined by demand/supply. Price is determined by scarcity/abundance, so that demand/supply only come to matter in the face of scarcity.
"Capturing value" is a bogus concept which shouldn't exist.
Think about air. Air is pretty cheap to the average human. Sure, there are other factors surrounding its existence like its quality in certain places based on gases dumped into the atmosphere by natural or human activity, or other things like geographical altitude. But no average healthy human pays a dime to afford air, important as it is to them. Ergo, air is very very cheap, even though it is of enormous value to each human.
The reason air is cheap is that there is an absolute abundance of it. This abundance exists in multiple dimensions, including:
(i) absolute abundance: there is so much being produced that compared to amount used up, the ratio of amount used up is completely negligible, hence never any scarcity (ii) its natural existence and recycling: there are no factories managed by certain companies who need to buy raw materials to produce and sell air as a good, or recycle used air for re-use (iii) It is 'plumbing' free i.e getting it to users is free. No one needs to build an air supply chain.
Water, which is also naturally existing, in comparison, is far more expensive than air. (i) It needs refining (production managed by people) for certain uses. (ii) It needs actual plumbing to get to users.
Not to talk about the same factors like pollution affecting it which also affect air.
So air is pretty valuable. The only reason for its cheapness is its absolute abundance, not the value it creates. Granted, air is entirely naturally-occurring, and then some people might argue that it is what is responsible for its cheapness. How about water then, which does require some work to become usable to end-users?
Why doesn't water have high profit margins?
And software is abundant not quite in the same way that air is, but like water is. Sure it does need some 'producing', but it is virtual and easily copy-able. New work done in making it available to one more user is very low. That factor is what gives it its abundance.
Why do software companies have high profit margins then? Why aren't Google and Facebook ads a lot cheaper than they are since it's all built on dirt-cheap software?