It's not rocket-science really. Either it's semi-random blabber based on trigger words or just basic messages with fairly obvious hints (grammar errors etc.) that the message was generated by a bot.
Spam bots operate the same way as email spam does. With the exception that bots are programmed to get pass half-assed board sequrity measures (or then there's no security at all) and automatically register itself. Spambots also scan board subforum titles and post (the most obvious trigger is the word "General") in specific forums that way.