There are several legends as to the origin of this custom.
The "good luck" traditions of eating black-eyed peas at Rosh Hashana, the Jewish New Year, are recorded in the Babylonian Talmud (compiled circa 500 CE), Horayot 12A: "Abaye [d. 339 CE] said, now that you have established that good-luck symbols avail, you should make it a habit to see qara (bottle gourd), rubiya (black-eyed peas, Arabic lubiya), kartei (leeks), silka (either beets or spinach), and tamrei (dates) on your table on the New Year." However, the custom may have resulted from an early mistranslation of the Aramaic word rubiya (fenugreek).
A parallel text in Kritot 5B states one should eat these symbols of good luck. The accepted custom (Shulhan Aruh Orah Hayim 583:1, 16th century, the standard code of Jewish law and practice) is to eat the symbols. This custom is followed by Sephardi and Israeli Jews to this day.
Another suggested beginning of the tradition dates back to the Civil War, when Union troops, especially in areas targeted by General William Tecumseh Sherman, typically stripped the countryside of all stored food, crops, and livestock, and destroyed whatever they could not carry away. At that time, Northerners considered "field peas" and field corn suitable only for animal fodder, and did not steal or destroy these humble foods.
In the Southern United States, the peas are typically cooked with a pork product for flavoring (such as bacon, ham bones, fatback, or hog jowl), diced onion, and served with a hot chili sauce or a pepper-flavored vinegar.
The traditional meal also includes collard, turnip, or mustard greens, and ham. The peas, since they swell when cooked, symbolize prosperity; the greens symbolize money; the pork, because pigs root forward when foraging, represents positive motion. Cornbread also often accompanies this meal.
Happy New Year Everyone! --Tim