Demurrage and detention: the paperwork that starts the clock
The definitions take one line each. Demurrage is charged while a container sits inside the terminal beyond its free time. Detention is charged once you have taken the box out and are keeping it. Demurrage is the port's floor; detention is the carrier's asset.
What is worth more attention is why the clock runs out, because it is usually not congestion. It is a document.
Free time is shorter than it sounds
A typical allowance is three to seven days at destination. That sounds generous until you notice what has to happen inside it: arrival notice issued, entry filed and released, delivery order obtained, haulier booked, slot available. Any one of those stalling burns a day, and days at demurrage rates are not cheap.
The clock does not care whose fault it is.
The document failures that cost days
A late or wrong ISF. For US-bound ocean cargo the filing is due 24 hours before loading at the foreign port, and a shipment that arrives without one can be flagged for examination on arrival. An examination is measured in days, all of them inside your free time.
No telex release, and the originals still in a courier bag. The cargo cannot be collected without a bill of lading being surrendered somewhere. If the originals are travelling and the vessel was faster, the box waits for the post.
A certificate of origin that has not been legalised. Where the destination requires consular legalisation, the chain — chamber stamp, then consulate — can take longer than the voyage. Started after shipment, it is started too late.
Consignee name mismatched between invoice and bill of lading. "Nordwind Import GmbH" on one and "Nordwind Importe GmbH" on the other is enough for a broker to stop and ask, and asking takes a day even when the answer is obvious.
A goods description nobody can classify. The broker cannot file an entry against "Item 4471-B". They will email you, and you will reply, and that is another day.
The clock does not stop while you sort it out
This is the part people find unfair and it is worth internalising. Free time is a contractual allowance, not a fairness mechanism. It runs while customs examines, while your broker waits for a corrected document, and while a consulate takes its time. The carrier is not obliged to pause it because the delay was not your doing.
Some carriers will consider a waiver for a delay clearly caused by them. Almost none will for one caused by paperwork.
Where to spend the effort
Everything above is decided before the vessel sails. The consignee name, the description, the ISF, the release method, the legalisation — all of them are set at origin, and all of them are cheap to get right then.
Check the set once before shipment, reading the invoice, the packing list and the bill of lading side by side and asking whether they describe one consignment in the same words. That review costs an hour. A week of demurrage on a single forty-foot container costs considerably more.