basically, yes, in most developed countries ships are provided with large amounts of fuel oil (bunker fuel) on credit, trusting that the large shipping company will pay in the very near future by wire transfer. In really sketchy 3rd world locations ships have to use cash from the captain's safe to buy fuel. If a ship is delinquent in its account with the local fuel supplier, the fuel supplier will file something in their local admiralty court for what is essentially a lien to seize the ship.
A 10.000+ container vessel uses 100-120 tons of fuel per day (see https://people.hofstra.edu/geotrans/eng/ch8en/conc8en/fuel_c...). Bigger ones are more efficient per container, but it'll still be more than 120 tons of fuel. If you fuel up, that's a lot of bunkers to take in. That's not paid in cash. Credit is used.