Why do companies sit on cash while they have debt? Why don't they use cash to pay down their debts?
Debt is cheap. Flexibility is valuable.

They hold debt + cash up to the point where the value of flexibility is still greater than the net cost of servicing the debt minus any interest earnt on the cash.

It saves them the transaction costs of re-raising debt when they need it, had they paid it down early.

It's cashflow that typically kills businesses, rather than profitability. So holding extra cash, makes long-term business sense: it's the ultimate safety net.