Cloaking is a technique banned by search engines (i.e. it should be avoided) that consists of generating different HTML content depending on whether it is intended for a visitor or for a search engine.
Indeed, it is possible to detect search engine robots through the presence of a specific User-Agent field in the HTTP requests that they send and show them a different content that includes extra key words that are not shown to visitors.
Nevertheless, if this technique is detected by a search engine (which is easy for them to do), the website runs the risk of no longer being indexed or even of being blacklisted (banished) for several months.