The containers have fittings at each corner into which these twist locks. Once locked in, the container can be safely moved by the crane. These cranes are powered by either electricity or a powerful diesel engine.
Container cranes are very expensive so not all ports will have them. A good gang of stevedores can move more than 30 containers an hour.