I don't know anything about specifically how OpenAI made this transition. But in general this nonprofit to for-profit transition happens a lot.
In general, when you run a for-profit company, the board has a responsibility to the shareholders to not hurt them financially. A nonprofit doesn't have these constraints - who would they be hurting? So if a nonprofit wants to do some weird financial transaction, and the board all agrees, they can usually just do it.
For example, a nonprofit can agree to sell its assets in a complicated deal, and there is no real "external review" of this. So, you could create a for-profit subsidiary that is wholly owned, and then sell off some or all of its stock to a new group of investors. Or create different types of stock, capped or noncapped or preferred or unpreferred or whatever, and allocate different amounts of that to different groups.
In particular, as long as both OpenAI leadership and the leadership of OpenAI's nonprofit parent firm (which are the same people, maybe?) agrees to this round of Microsoft investment, they can probably rewrite the terms in any way they want. Including in such a way that leaves the ownership being 49% Microsoft, 49% other investors, 2% nonprofit parent.