The density of the storage is higher. Put simply there are more NAND flash memory chips (or the chips can hold more). The chips are very small though, so there is some empty room in most USB sticks. Making the chip bigger, or adding a second is almost always possible in the same space.
To save space, NAND flash chips also often package two pieces of silicon to same "chip", meaning the plastic/ceramic piece you usually call "chip" has one, two or four individual pieces of silicon inside. This comes with performance cost, but on USB stocks performance is not usually a concern. This all is made possible by transistors used to implement the memories shrinking all the time.
If you think about microSD cards, they are smaller than nail on my index finger, and they still come with capacities of 16 GB or more. Or SD cards, size of a stamp and 2 mm thin, come in capacities of 128 GB... And one SD card is easily smaller in physical volume than most USB sticks.
It is also a common practice in electronics design to first create the top-end model with all bells and whistles and then just not install some components to get the cheaper models; so these two sticks might very well be all identical, except one of them, while having space for another 8 GB die, does not come with it installed.
The reason for this is that designing the circuit board, testing the design, making molds for plastic parts, etc. is the expensive part. Making a single unit is cheap compared to that. Which means it makes sense to keep the plastic cover and circuit board identical, and just leave out some components, because you then save on the expensive part, materials.