Manufacturing can often be like hot dogs and hot dog buns. The end product is a hot dog in a bun but hot dogs come in ten packs while buns come in four packs each for their own reasons. The most efficient combinations of dogs and buns are common multiples but demand isn't always in those neat numbers. Storing the dogs and buns can be expensive and they will go bad so there's no guarantee you can ever use your stock of stored buns and dogs. If there's a counterfeit market for complete hot dog units you can unload the overproduction and not need to worry about storage or spoilage. You're in the hot dog construction business, not hot dog component storage business.
Clothes are particularly susceptible to the overproduction/counterfeit market.
I am thinking here particularly of counterfeit chargers, which are designed to mimic the originals to comical extremes—so that you essentially wouldn't know without tearing them apart—but which are missing crucial safeguards that mean that they are much more prone to catch fire. If, as ClumsyPilot suggests (https://news.ycombinator.com/item?id=27573695), you are thinking only of fashion items, then it's probably less of an issue.
Then there is a whole community of people that evaluate which batches are of higher or lower quality. Personally I don't buy counterfeits at all, the hyped shoes nowadays are just reskins of old designs and aren't that comfortable or imo look that exceptional.
Certainly, don't buy counterfeits that plug into mains though, unless you really really really know what you're doing.
There are counterfeits that are of low quality, with a suitably even lower price, but by doing some research you can often tell.
This is a big problem for sneakers, counterfeits are often literally impossible for anyone to distinguish. In my high school a kid would be selling knock offs of hyped shoes and brought them to official stores or specialized resellers and got them appraised as authentic, repeatedly.
Now I hear through the grapevine that they have to use things like the rigidity of the cardboard in the box they came in with to try and figure out fakes, because the shoe itself is just too close to tell.
Ultimately there's nothing magic to the original. The products are generally much cheaper to make than they are sold, so there is no reason why someone couldn't make a version with better materials at the same cost. It's a question of imaginary property and signaling more than anything.