Sea shanties are work songs used by sailors during the Age of Sail. One singer (the shantyman) would lead the singing with the crew joining for the chorus.
A work song is used to keep time and coordinate the effort of a group of men. And there is a lot of work to be done aboard a wooden ship. Lines need hauled, capstans turned, cotton screwed, and bilges pumped. These shipboard tasks are done to different timing and thus required songs with different tempos.
Songs were also used as a form of entertainment. These did not have to adhere to certain timing and were sung in berthings, the fo’c’s’le, or on deck near the fore bitts. Thus, these songs were called forebitters and were often about bravely heading out to sea, returning home to loved ones, or looking forward to the next port call.
Learn more at Historic UK or Stan Hugill’s Shanties from the Seven Seas, which not only has a lot of traditional shanties, but a wealth of general information about those who sung them.
If you are researching individual shanties and don’t have a collection of shanty books, Mudcat.org is an excellent resource!