By measuring the motions of nearby waves and vessels with radar and lasers, the software running a crane can predict exactly how a ship will be pushed, and react accordingly.
Visibility: a crane, ship, or lorry built to accept a container doesn't care what is inside each one, and the contents of each container is irrelevant to all the others.