Bellows are also used in folding cameras as well as expandable buses, not only on boats. In a vehicle, your cooling system is always enclosed in the frame itself, while on boats, it is an open-water cooling system. This means boats dump the heat from the engine outside to keep the engine cool.
Sealing the drive shaft
For a Stern-drive engine, bellows are purposed with sealing the drive shaft. While you are at rest, the bellows remain on the water. Any leakage can sink the boat easily. To keep your boat from such fatal accidents bellows play the role to save the engine and the drive shaft of your boat.