Cloaking is a part of the unethical practices in SEO that offers deceiving mechanisms for the search engines. It provides use of false pages that are loaded with the keyword and other content that is search engine optimized. Cloaking enables search results to get rank the page higher in search engines. Not very prevalent after the recent Google algorithm updates which penalize keyword stuffing.
Cloaking is a technique used to deliver the content on a Web page to a search engine in such a way that different content than what is delivered to a regular human user appears on the search engine. The goal of cloaking is to boost a website's search engine rank on certain keywords.
It is un-ethical Black Hat SEO technique. The programmer write a content for search engine purpose, but not for the people. Consequently, the search engine see one content, but visitor see other content. Its violation of Google Webmaster guidelines.