Company A sells widgets for dollars made from raw materials bought in yen.
Company B sells woggles for yen made from raw materials bought in dollars.
Both companies can reduce their risk by agreeing to exchange yen for dollars at an agreed fixed value. No one is gambling. Everyone is reducing their risk.
Interest rates, some companies may have floating income they wish to swap for long term fixed, and others may have too much long term debt which has a volatile mtm value.
Counterparty risk, usually mitigated by diversification. Companies pool their specific risk for a lower, but more certain, general risk (and use clearing houses).
Liquidity risk. Only a problem if you need to sell something quickly. Here there are gamblers taking advantage. There’s no-one that naturally wants to take the other side of illiquid assets.
You are gambling whenever you get in your car and drive. You are gambling if you get out of bed. You are gambling if you spend too much time in bed.
Risk being present isn’t enough. I think the definition of gambling should include a willful decision to increase the level of risk.