A CAPTCHA (an acronym for "Completely Automated Public Turing test to tell Computers and Humans Apart") is a type of challenge-response test used in computing to determine whether or not the user is human.

The reason websites have CAPTCHA is spam. The crazy letters are a way to check if the person registering or trying to comment is a real live human being as opposed to a computer program attempting to spam the site.