It took me way longer than is reasonable to realize that a cog in this context is a type of ship. It does not contain gears of any size, giant or small.
They have the same etymological root, from a Proto-Germanic word for a lump, which is the tooth (cog) on a cogwheel, or the round bulky lump of a cog ship.