Im a little late to the party but your looking at something that number 1 is in genetics.
Some strains dont have nice dense bud structure. It can feel dense while growing but become soft and squishy during the dry, some strains are even fluffy during the grow, though not many are.
Your second factor is DLI or the amount of light your canopy receives in a 24 hour period. This imo is 2nd next to genetics. You really wanna get as even and as close to the max amount of light your plants can handle given the environment they are in. This depends on a couple things such as cultivar (auto/photo), amount of available food and water, and maintaining a good temp and humidity. If all 3 of those are dialed in right you can really ramp up your light to its max. In autos I wouldnt go above 700ppfd for 20 hours a day. That puts you right at about 50dli, photo plants can handle more 800-1000ppfd for 12 hours 50-60 dli a day in flower and in veg they can handle 400-650ppfd for 18 hours a day, about 40-50dli, though at those top ranges everything has to be pretty close to perfect.
3rd in my opinion is maintaining proper nutrient levels. If your plant dont have the food it will grow but not to its potential. If your food and water is in check along with your environment and light you give your plants the best chances for those nice dense buds.