From China Digital Space
山寨 (shān zhài): mountain stronghold
The term "shanzhai" originally refers to a mountain stronghold, especially one which housed bandits evading authority.
Contemporary colloquial use of the term refers to cheaply produced and sometimes poor-quality imitation products. Resignification of the term traces to Cantonese slang, which applied "shanzhai" to shanzhai "factories" in Hong Kong that were small, low-end, non-brand name producers of goods. By assuming brand names, and imitating the appearance and capabilities of products, "shanzhai" goods were able to escape official authorities' detection and evade tax payments.
The term has expanded to describe any knock-off or imitation. An average singer with a striking resemblance to Taiwanese pop star Jay Chou, for example, may be called a "shanzhai Jay Chou."