This old saying is still used to mean to hit someone forcefully and repeatedly. There are several versions of the origin of this metaphoric expression.
Folk etymology says that “The actual meaning goes back to our seafaring days when sailing ships found themselves slogging through storms. The watch officer maintained high alert during such times because savage winds at sea could wreak havoc on a sailing vessel.”
Where Did That Come From?- Beating the tar out of someone