The word peacock was coined at the start of the fourteenth century, but there was a lot of variation in Middle English: we saw forms like pecok, pekok, pocok, pacok, and poucock rise and fall in usage. You can sort of see here that peas have nothing to do with it, despite how the modern word might look. The elements involved here are probably po-, pertaining to birds also found in peafowl and peahen, and coc, meaning "hen" and precursor to both the modern words for chickens and penises (the connection being the concept of fertility). Po in all likelihood is from Old English pawa, which is from Latin pavo (the etymon of the Spanish word for "turkey"), which could be from an Ancient Greek word for "peacock", and that could be from Tamil, which would be interesting, but it's all speculative at that point. Coc is from Proto-Germanic kukkaz (same meaning), of imitative origin. Usage of the word peacock has been decreasing in literature since a peak in the late nineteenth century, and has been pretty constant in Google Trends since 2004.
Hello! I'm Adam Aleksic, a sophomore studying government and linguistics at Harvard University, where I co-founded the Harvard Undergraduate Linguistics Society. In addition to etymology, I also really enjoy politics, vexillology, geography, board games, conlanging, and law.