Sludge is basically what happens when doom gets mixed with hardcore.
The more traditional brand of sludge is pretty bluesy and the doom is more prominent:
Then Neurosis came along and took influences from these bands, even more hardcore punk, and some Swans as well as tribal music and ambient and created.
Mastodon took this sound that Neurosis pioneered and streamlined the everliving fuck out of it to something that was catchy and much more easily digestible (but still very good.) Though they eventually would drop most of their sludge aspects sometime around Leviathan.