Cloaking is when a single page serves one thing to a website visitor and something completely different to a search engine bot. For example, the website visitor might see the way you want the page to look, but the bot might see something that is completely tailored for optimal SEO, keyword stuffing, etc., that doesn't even resemble what a human sees when they go to the page.
For example i want to know about Google algorithm. so i enter a keyword like "Google algorithm" in Google search box, then it show large list of sites.i choose the first site and i am shocking that site is related to "buying a t-shirt".This what called cloaking.just having unrelated keywords to a site
Let's say that you have a website that sells blue widgets. But the keyword "red widgets" is less competitive in Google and can send you more traffic. Blue widgets are very competitive in Google. So you use cloaking to fool google into thinking you sell red widgets, so you get a lot of traffic from people looking for red widgets. But when human visitors go to the site, only blue widgets are for sale.