"Who" and "whom", "he" and "him", "she" and "her", etc. are remnants of both the old nominative versus accusative and also of nominative versus dative. In other words, "her" (for example) serves as both the dative and accusative version of the nominative pronoun "she". In Old English as well as modern German and Icelandic as further examples, these cases had distinct pronouns.
This collapse of the separate case pronouns into the same word is one of the reasons grammarians consider the dative and accusative cases to be extinct in English — neither is an ideal term for the role played by "whom". Instead, the term objective is often used; that is, "whom" is a generic objective pronoun which can describe either a direct or an indirect object. The nominative case, "who", is called simply the subjective. The information formerly conveyed by having distinct case forms is now mostly provided by prepositions and word order.
Modern English morphologically distinguishes only one case, the possessive case — which some linguists argue is not a case at all, but a clitic (see the entry for genitive case for more information). With only a few pronominal exceptions, the objective and subjective always have the same form.
1 - Most generally speaking, in non-subject rules: "whom" is used in "formal" situations and in writing, while "who? is colloquial or "informal". A dialectal investigation should be taken into consideration, of course.
Note that the ye/you distinction still existed, at least optionally, in Early Modern English: "Ye shall know the truth and the truth shall make you free" from the King James Bible.
Formal and informal forms of the second person singular and plural