Firstly genetics, reputable suppliers producing solid strains. Indica/hybrid varieties more dense than sativas too.
Secondly, enough light at the right spectrum.
Third, soil, light, aerated and plenty of it.
Fourth, nutrients, applying the correct ratios of n at the beginning and PK during flower and making sure to provide a form of calcium and magnesium to facilitate these nutrients better.
Fifth would be plant training and defoliation,
Training your plants to use as much light as possible, trimming the branches from lower down that would only ever make an airy half gram of bud (lard). Taking off big fan leaves throughout the flowering phase to slow light to penetrate down and below.
Sixth would be , fans, cannabis is wind pollenated so the more " wind" your indoor plants receive will produce bigger flowers.
Now I'm sure you're doing most of these things, but if there's something here you suspect you could do more off, give it a try!