The previous editor did a great job with the answer. However, there are a few more ways companies ensure to customers the genuineness of their product. If the item is an electronic item, often times the company will have a code within the packaging, which you will need to use the product. For example, I just bought the movie UP and it came with a code.
In high end things like designer bags or items of clothing, the packaging comes with a certification of authenticity, which cannot really be imitated, since they come with a number or code, which you can then use to verify when and where the item was made. For instance, I recently bought something from burberry and it came with a card of authenticity.
The basic approach to prevent counterfeiting in packaging of fast selling products is same as that used to prevent counterfeiting of currency notes. This approach is to use packaging material and processes that make it difficult and expensive for someone to make counterfeit packaging in small quantities.
People counterfeit only products selling in large quantities to take advantage of the consumer acceptance of the product. The manufacturer of the genuine product is able to afford the packaging as with their large volumes their unit cost is low, but for the counterfeiter who can only sell limited quantity of counterfeit products, the unit cost is high.
Some of the techniques of doing this is to use containers design and materials that involve high fixed cost for dies and and other templates. Manufacturers also put hologram stickers on the packs which can be produced economically only in large quantities. Another techniques is to use very high quality of printing on packaging material that can only be achieved by using sophisticated printing machines, to which the counterfeiter may not have easy access. As counterfeiting is an illegal activity, the counterfeiter cannot get their printing done from large and reputed printers with such sophisticated equipments.