Also not all “capitalists” have aligned incentives. Everybody wants shipping to be efficient except those who profit from this inefficiency.
Specifically ship companies are making huge profits by racing to the big East Asian ports right now. So much profit that they don’t want their ships to wait in US ports for empty containers to reload. This asymmetry makes it even more profitable to rush back to those East Asian ports. Snowball of profits for them at the expense of everyone else.
This is a Tragedy of the Commons situation. It is a great purpose for government intervention.