What are the small electric locomotives on the canal used for?

The locomotives, (Electric Mules) are used to pull ships through the locks of the canal. Also due to the very close fit of the largest ships (like the panamax tankers), the locomotives work together to maintain ship position within the width of the locks. sometimes there are only inches to spare on each side.