The individual incentive is to open source code to show the rest of the industry what you have been able to build, with personal returns to you if it actually gets meaningful adoption.
And companies are willing to go along with this because infrastructure projects are not actually a source of competitive advantage and they would rather co-operate on keeping input costs low, and also not get stranded on a tech island with totally custom tooling for everything. You also derive some marginal benefit if the OSS code actually gets used by others since you still control the project direction.
And then separately you have OSS first companies that are hoping that being OSS lets them gain a marketing/sales advantage with developers who care about that.
These incentives remain the same even if there is no meaningful surplus.