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.
Sam: Anagram, maybe?
Dean: I think it's an anagram.
Kraus: A what?
Dean: An anagram. Same letters, different words.
Dean: You know, it's, uh, maybe word fragments... other times, it's anagrams.
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.