"The idea is to give words that are anagrams a common signature, sort all the words together by their signatures, and then print them."
https://www.gnu.org/software/gawk/manual/html_node/Anagram-P...