Good question! I understand the concept and rationale but you are right that it would seem to be a hard thing to implement in practice. Do customs officials get issued hugely detailed product guides that tell them where to look for the super-secret factory mark to confirm that a product is legit? What happens if a flood in China makes a company switch temporarily to a Thai factory that then churns out a fair number of legit but slightly different looking products? Do they have to notify customs ASAP to prevent the seizure of these products?
Customs only seizes counterfeit products on the direct request of and supervision by the company manufacturing the legit product.
Customs only seizes the most blatantly obvious fakes, ones that no reasonable person could conclude were real.
I don’t know how often customs seizes goods by mistake but I can tell you that you generally aren’t getting money from them if you are an importer that is targeted unjustly or otherwise. I am very familiar with the gourmet foods industry and the federal agencies responsible for monitoring its importation. In the case of gourmet foods (especially cheese), there is always some percentage of product that is held for testing and records checking. It isn’t just individual cases. Whole shipping containers the size of tractor trailers are picked for either random or “for cause” investigation. The product just sits at the inspection site near the dock until the relevant federal agency clears it. The irony is that, even if comes back clean, the whole process takes so long that the entire shipment usually has to be destroyed unless it is a non-perishable product. The importer won’t even get so much as an official apology and they have to eat the losses that can range into the hundreds of thousands of dollars (just kidding, nobody is eating anything because they held it so long it can’t ever be sold even if there was absolutely nothing wrong with it in the first place).
Importing businesses have to build such costs into their business model and develop a good relationship with the local federal bureaucrats to minimize such needless losses.