It is similar to envy, in that it is about the desire to lower another's utility without any personal gain. However envy is general, whereas hatred is specific. An envious person generally wants those who are better off to have less, so they are not as poor in comparison. Hatred is generally directed at an individual, or members of a specific group (eg members of a particular race, religion or political persuasion).
Hatred is one of the emotions which is inherited genetically. The phenomenon seems irrational at first, as it is likely to decrease the chances of survival. However like revenge, it has a long term benefit. The killing of an entity which has harmed you (or your family) in the past will (if nothing else) ensure that the entity does not repeat the actions, and may also act as a warning to others considering doing so.
See