Cock meant chicken, but now means penis. Why such a dramatic change?
A lot of taboo words start out as euphemisms and then they're used so much in a "bad" context that they become taboo themselves. In the case of "cock," that's what male chickens or roosters are called and it was used as a symbol for vitality because roosters can be very aggressive. That may not seem so obvious today because most people live in cities and don't spend time around farm animals but for thousands of years "cockfighting" was an extremely popular sport where people would bring roosters and put them in a pit (called a cockpit) and they would literally rip each other apart while people placed bets on the outcome. If two roosters are ever put together in a henhouse they'll usually kill each other.
All human languages have taboo words that people use, but what those words describe tends to depend on what those societies consider taboo. In the past in Western societies that placed a lot of importance on Christianity, a lot of swear words had to do with blaspheming (God, damn, hell, devil, etc.) but there was lots of sexual slang as well just like today. In the late 17th century, slang words for penis included tarse, prick and pintle. The word tarse comes from the French word for a male falcon which was associated with masculinity, and prick and pintle both describe pins and penetration which obviously alludes to sex. The etymologies of euphemisms are sometimes hard to pin down but they usually have an origin that makes some sense.
Hi, here's a previous answer by /u/Gorrest_Fump