They knew where the market exist,so embraced Linux. They wanted to prevent migration of windows users to MacOS/Linux ,so created WSL2 which lured many MacOS users.
It also added DirectX for WSL2 , which is proprietary extension. It based it's edge browser on chromium because they were lagging behind chromium wrt performance.
They want profit. So,they do these things. Some actions benefit floss while some don't. Problem of capitalist company. They care about capital more than us.