In two different places the talmud (Horayot 12a and Keritut 5) discusses the validity of omens; foods that we eat which are accompanied by prayers can be a good sign for the coming year. Based on this we eat special foods during the Rosh Hashanah meal accompanied by special prayers to God that the good omens that the names of these foods represent should be fulfilled in the coming year.
Squash in Hebrew Kara we pray that God should rip up the evil decrees against us and announce our merits.
Rubia - Green beans or Black-eyed peas our merits should increase.
Karti - Leak we pray that our enemies should be cut off.
Silka - spinach or beets we pray that our enemies should be removed far from us
Tamre - dates we say a prayer that our enemies should be ended.
The Ben Ish Hai explains that we have three kinds of enemies mentioned in these special blessings the first are our physical enemies here in this world. Israel is a small country surrounded by enemies. Jews are surrounded by anti-semites.
The second kind of enemy is of the spiritual variety that are actually created by our own evil deeds in the spiritual dimensions above and we pray to God that these enemies should be completely destroyed.
The third kind of enemy are spiritual prosecutors that accuse us of doing evil in the world. We ask God to move them far away from us.
Apart from these foods which are mentioned in the Talmud, the Tur - a halachic guide written in Spain prior to the expulsion - discusses other customs. For example the widely accepted custom of eating sweet apples dipped in honey to pray to God for a sweet New year.
The Taz - a halachic commentator says a person should eat apples to hint to the field of holy apples mentioned in the Zohar.
In Provence, southern France the custom was to bring a new food on the table to say the blessing of shehiyanu which is a prayer thanking God for another year of life.
It was also a custom to place on the table a piece of the head of a sheep to hint and pray to God that we should always be the head - ie rise to the top in all our endeavors and not the bottom - the tail. Also to remind God of the sacrifice of the ram of Isaac in order to provide us with special protective merit from the amazing deeds of our forefathers.
The Rema famous Ashkenazi Halachic decisor quotes the custom of eating Pomegranates and praying that our good deeds should be as multiplous as the seeds of a pomegranate. He als states the custom to have a tasty meal and drinks.
The Chafetz Chayim states the custom to eat fish as a sign that we will increase and multiply in the coming year.