For a complete answer to this question, I suggest the book The Unfolding of Language: An Evolutionary Tour of Mankind's Greatest Invention by Guy Deutscher.
The short answer is that different languages emerged to serve the needs of different cultures in different parts of the world. As different cultures began to interact with each other, they began to share concepts and structures of each other's language. Languages were never actually "invented."
Consequently, languages form a type of family tree, with some more closely related to each other than others. English, for example, is more closely related to the west Germanic languages of Dutch and German than it is to the Slavic, Romance, or Iranian languages.