Adding the baking soda or sodium bicarbonate to the pan raises the pH balance to create an alkaline environment. This quickly breaks down the cell walls of the onion causing it to lose it's structure. The result is almost like an onion paste that's able to dissolve into whatever you're cooking.