And how exactly this earns money for them? embrace extend extinguish
c# is open source. There are other c# implementations like mono which are used in projects like unity.
Microsoft SQL Server is closed source. They take open sourcing in a case by case basis, and the primary motivator seems to be money.
Yes, it's not for altruistic reasons but to lower the barrier of entry.
Vscode is a bad example, almost all useful Plugins are closed source on purpose, the package they ship also includes modifications that aren't open either.