Basics of Cloaking
Cloaking generally means to present different version of web page contents from of search engines to search robots and human visitors based on their browser's user agent or IP address. It's a deceptive method used to cheat search engines in order to rank well for desired keywords.
Not always but in most of the cases, cloaking is also used to trick users to visit certain websites based on their description in search engines. For example a user searching for some product may click on a website in search engine based on its description and title but the final website will not be the one described in SERP's. It will be a totally different one. Therefore, these practices that are designed to manipulate search engines and deceive users by directing them to sites other than the ones they selected, and that provide content solely for the benefit of search engines should be avoided.
Check if a site is cloaking or not: Free Online Cloaking Checker
Different Cloaking Methods
IP address Cloaking - a method of presenting different contents based on determining IP addresses. e.g. Search engines with certain IP addresses will be shown a one version of a web page and all other IP addresses will be shown another version.
User-Agent Cloaking - a method of delivering different versions of a website based on User-Agent. e.g. Search engines and/or users using different versions of web browsers are served with different contents of a web page.
HTTP_REFERER Header Cloaking - if a user is coming from a certain website (e.g. clicking a link from search results or a website) they will be presented a different version of a website based on the HTTP_REFERER header value.
HTTP Accept-Language Header Cloaking - may be used to show different versions of a website based on a users web browser language without letting them for an option of language selection.
Finally, cloaking can be a dangerous thing so be careful while using it.