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.
Adam Aleksic, a freshman studying linguistics at Harvard University, has been described as the internet's sixth most famous etymologist. He has disturbing interests in words, vexillology, geography, board games, limericks, and law, and he loves writing about himself in the third person.
The Etymology Nerd