Retailers like Dollar General, Dollar Tree, Family Dollar are big enough that they are almost certainly buying direct from the manufacturer. Putting something in smaller packaging is done solely to meet a price point. It doesn't mean someone is counterfeiting the item and screwing up the size. Using Dollar General as one example, they appear to sell the identical things that you'd get at Walmart, Kroger, etc including the packaging size. Stores like Dollar Tree - where everything is truly $1 - sells less well-known brands as well as much smaller packaging. Again, that's to meet the price point of $1 though. They sell engine oil in 16oz bottles for $1 and everyone thinks it's garbage oil but I think someone checked into it and it's "good" oil.
I would never use someplace like Walgreens, CVS, etc for price comparisons. You pay through the nose at those stores for the convenience.