Cloaking is a black hat technique. Cloaking are generally done by webmasters to present different version of web page contents from of search engines to search robots and human visitors based on their browser's or IP address. It is a illegal method used to cheat search engines in order to rank well for desired keywords.
Cloaking is a method/trick used in Search Engine optimization. Following is the information about Cloaking which i have grabbed from the wikipedi article, go through: Continued: http://en.wikipedia.org/wiki/Cloaking
Cloaking is showing the spiders a separate page from what a human visitor will see, and people have done that to prevent Google from sandboxing sites that are thin affiliate sites shooting for long tail keywords. Masking helps beautify links as well as provides ways to frame remote offers within the permalink structure of your site, as well as provides in-depth in-house click-tracking opportunities not afforded by other analytic programs.