Cloaking is black hat SEO technique in which web page content is not visible to the visitor. That is only for search engine spider. But it is harmful for the website.
I did cloaking years before. I cloaked links within the blog. The links were affiliate links. Back then, Google wasn't fond of affiliate links, and so webmaster did tend to hide their outbound affiliate links through cloaking.
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.
Cloaking is one of the black hat SEO techniques which means you are showing different content for the humans and search engine bots. Or your content is only for the search engines and it is not valuable for the humans. This is known as cloaking.