How the toilet came to be called the Head is a really interesting question. I had to do a bit of searching to find the answer.
About 600 years ago, the front of the boat was called the ‘head’.
No-one knows the exact date when the word ‘head’ was used to mean the toilet.
Early boats had very shallow keels. That’s the bit underneath the boat that stops it from tipping over. Because of this, early sailing ships sailed best when the wind was coming from behind them.
Toilets can be pretty smelly places, so the best spot to have them was downwind, where the wind was blowing the smell away.
Because the head of the boat was the farthest spot downwind and away from people, that was where the toilet was placed. With the waves splashing over the bow as the boat plunged into them, this was also the wettest spot. It meant the toilet could have a bit of a wash to remove some of the smell.
The early ship’s toilet was made by making some rails that the sailor could lean on or sit on as he hung out over the water. Over time, the toilet became one that had a wooden plank seat with a hole in it.
As technology became better, plumbing a toilet inside with pipes, valves and pumps that would stop a boat sinking became possible. The toilet was moved inside at last.
Every boat looks different inside. This is what the head in Gratis looks like.
It can be wet and dangerous at the bow of the boat. I am so glad we have toilets inside.
Note: Today we call the front of the boat the bow.
The illustrations not by me are images I found on Quora, Wikipedia and https://catamaranguru.com/term-head-boats/.