According to Dr. Daniel Goleman, an expert on emotional intelligence, jealousy is considered to be a secondary emotion (comprised of Anger, Fear and Sadness), that emereges when a relationship is being comprimised by a rival.
In biology, jealousy is thought to ensure the survival of the individual. Think of a pup showing signs of jealousy when it's mother feeds it's siblings, in order to get food as well.
You should be careful to distinguish between jealousy and envy. While both are a realtively negative emotion, jealousy is considered to be constructive and benefecial in the long run, as it promotes improvement. Envy, on the other hand, is Jealousy times 10, where the individual is so Jealous, he almost prefers for his rival to lose it all, then for him to gain. Anger plays a much more vital role in Envy.
Read more here.