in general, it's not blackhat technique.
It's done to:
1- shorten the URL address.
2- hide affiliate links, So customers will click it and don't expect it affiliate link.
3- tracking links (which link clicked)
The methods of doing it is much:
1- by html redirect.
2- PHP redirect
3- htaccess redirect
4- by scripts or software (more professional, more costs)
Cloaking, as it is generally perceived, is a way to provide better looking links. For example, on a WordPress site, the GoCodes plugin allows a shorter, friendlier URL that can tell your visitor where the results of their click will take them, instead of some affiliate code. It also tracks clicks. Visitors are more likely to click through a nice link. G has not penalized my sites for using this. The same results can be achieved with other types of redirects, and I have never seen this referred to as masking.
There is also a definition for cloaking that is blackhat. This would be something like User Agent Cloaking or IP Cloaking by visitor. That definition is for something designed to cloak a site from search engine spiders, by presenting one page to your visitors and a different page to a search engine. This technique is never recommended, as it can cause more problems than it's worth and get a site deindexed. A better approach is always proper on-site search engine optimization.