From China Digital Space
山寨 (shānzhài): mountain stronghold
The term “shanzhai” literally means “mountain stronghold,” and was used to describe the mountain stockades which housed bandits and warlords who were evading authority.
Contemporary colloquial use of the term refers to cheaply produced and often poor-quality imitation products. This use of the term originated with Cantonese slang, which applied “shanzhai” to small, low-end factories in Hong Kong that produced non-brand name 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.”