Keeping anything, from human flesh to ropes to wood, fresh and clean at sea is a challenge almost beyond imagining. Water and its salty components like nothing better than to work their way in, causing mold and rot at an alarming rate. Sailors, being resourceful, in love with their ships and unafraid of hard work, developed solutions for such problems. Fresh they will keep the ship; clean is a matter of habit and opinion.
First among the seaman's arsenal against the damaging effects of water is tar. This simple substance is made from the resin collected from the bark of certain pine and juniper trees. It is distilled and heated to make it liquid where upon it can be applied to almost anything as waterproofing. Rigging is tarred regularly so that the ropes stay supple, workable and dry. This is an arduous and dangerous process that involves swinging high above the deck in a bosun's chair holding a bucket in one hand while using the other to tar the ropes.
Canvas can be tarred as well; thus the origin of the tarpaulin which covers things at sea and on land to keep off salt spray and rain alike. Tarpaulin is another name for sailor, as is simply tar or Jack tar. This references not only the fact that some hands never came entirely clean and were perpetually black from tarring, but also tar used as a hair treatment to keep long braids waterproof at sea.
Tar's mate aboard ship was tallow. This, of course, is rendered animal fat, most commonly from a cow. Used in candle and soap making, it was slathered onto masts and booms aboard ship to keep the weather out. This was another hazardous job that again required dangling at precarious heights, this time with your hands covered in one of the slickest substances known to man. It's a wonder any sailor got home whole and hale, frankly.
Tar and tallow have gone by the board in modern fleets, of course. Metal ships propelled by engines don't need such simple if difficult care. But there was a time when no ship could run if both were lacking, and no sailor would think to weigh anchor without them.