Even today the sea bed is not adequately mapped. To do so would cost a fortune and because of underwater currents that move continuously, any map would soon be out of date. Modern ships have many electronic methods of determining the depth of water beneath the keel.
It is therefore rare today for a ship to "Run aground" and if it were to happen, reversing the engines or the use of powerful tugs would soon pull the ship clear of the underwater obstruction.
In the days of the Galleon, no such methods were available at that time. With no engines, only sail, to "Run aground" could mean the loss of the ship and the crew.
So as the old sailing ships neared land, it was important to know the depth of water beneath the keel. Most sailors had no formal education, therefore a very simple foolproof system was invented. A lead weighted rope was set to have a knot tied every fathom length. A fathom being 6 foot
A sailor had the job of throwing the weight forward and feeding out the rope until he felt the weight hit bottom. By now the rope should be vertical in the water. The sailor retrieves the rope counting the knots that were submerged and calls out very loudly 30 fathoms.. (or whatever the count was)
Unfortunately because of the lack of education, most sailors could not count too well. Therefore they had to "Fathom out" this simple mathematical problem. Even today we "Fathom it out" when faced with a problem.
It was very hard work throwing and retrieving this heavy lead weighted rope. So the lazy sailor would pretend to do it when he thought that no one was supervising him. He would stand there "swinging the lead" so that as soon as an officer appeared he could let it go forward and appear that he had been correctly doing his job all along
Even today we use the expression "Swinging the lead" when someone is being lazy and not doing the work that they are paid to do
Incidentally as a footnote:- the speed of the ship was calculated by laying a very long floating rope on the water and counting the knots as they go passed in a given time. So today speed on water is always expressed in nautical "Knots"
Not a lot of people knows that.... as Michael Caine would say
Odd how many expressions we have from our Naval past