Typically the natural gas is the source of the hydrogen. Usually natural gas is burned to form steam to split more natural gas (CH4) into carbon and hydrogen. That’s traditionally cheaper than electrolysis.
Free has a habit of changing the economics. This is good news, decoupling ammonia from natural gas would make agriculture more resilient to Middle East disruptions.