Short answer: genetics, light intensity, and phosphorus uptake.
Indicas are usually denser than sativas. More light or more phosphorus will not push density past genetic potential, however lack of light intensity or lack of phosphorus uptake (for whatever reason) will prevent buds from reaching their density (and size) potential. Also, along the lines of light intensity, if something happens to your leaves (fungus, mold, bugs, frost, heat issues, PH issues, P issues, trimming, light burn, etc), buds will be less dense, 'cause leaves are the solar panels of bud production.