Comes from the Greek "ana" meaning "back" or "again" and "graphein" meaning "to write". It is a type of word play, that consists of rearranging the letters of a word or phrase in order to produce other words, using all the original letters exactly once. In a more advanced, sophisticated form of anagramming, ones goal is to 'discover' a result that has a meaning that defines or comments on the original subject in a humorous or ironic way as in Somewhere Over the Rainbow ~ Worrisome However Beneath.
Anagrams have been used in literature for quite some time. The most famous anagram in horror literature is the word REDRUM (Murder), rewritten over and over again in Stephan King's novel "The Shining".
For an elaborate occupation with Anagrams go here.