With food products, we may have a real preference for the national or international brands because of taste or texture or something. Otherwise we generally get the store or generic brands so long as the quality is acceptable.
Others have mentioned reading labels carefully, which I always do, and not just to verify that the cheap brands are the same as the expensive ones. Even within the same brand, you need to be careful. For example, there was a cleaner or degreaser, "409" or similar, that was available in a regular household version and in a professional custodial version at a 20% higher price. Right beside each other on the shelf. But the ingredient declarations, which included the percentage of each active ingredient, were identical.
And once while we were shopping my wife was trying to decide which "ant traps" to buy. There were four varieties from the same manufacturer - something like regular, heavy duty, indoor, outdoor. Again, the ingredients and their percentages in the formula were listed on the packages, and again they were identical, but all at different prices.
Caveat Emptor.