The headlines tell us that tens of thousands of shipping containers are waiting to be unloaded at the nation’s ports. But owing to labor shortages, the ships and their cargoes back-up and domestic supply lines suffer.

But there’s something else at work behind these headlines. As the Competitive Enterprise Institute’s Sean Higgins writes, the labor unions that control the port workforces are a big reason all those goods are sitting idle:

Most workers do the standard eight-hour days five times a week but can be required to stay on the job for up to two additional hours while getting overtime. After that, they can go home if they want.

The simple way to ensure around-the-clock operation at the ports without forcing the workers to do even longer shifts would be to create multiple different shifts and stagger them across the week. Maybe throw in a little extra to get people to work a midnight-to-dawn shift. It’s not like there is a shortage of work to be done and more workers couldn’t be hired.

Except the union contract limits the port to just three shifts in a day: two lasting eight hours and another lasting just five hours. All three go from Monday to Friday. These shifts overlap slightly but even if they didn’t, they would still only total 21 hours. Keeping the ports open for 24 hours would require the port to pay overtime every single day. On top of that, the contract says that any work done on weekends or holidays is automatically time and a half too. So even if the port could offer shifts with a five-day work week that started on, say, Wednesday, it would have to pay those workers the equivalent of six days.

Also, holidays that require paying time and a half include not just the regular federal ones but the birthdays of Cesar Chavez, founder of the United Farm Workers, and Harry Bridges, founder of the ILWU. The contract also counts July 5 as a holiday. The day after July 4 is “Bloody Thursday,” commemorating an incident in a 1934 strike in which police killed two rioting dockworkers.

And forget about increased automation: the union has “fought tooth and nail against any step in that direction.”

Add all this up and it is clear part of the reason for the port delays is built-in to the system…to the benefit of the union and its members and to the detriment of consumers across the U.S.