What factors lead to rich crema on espresso?
Crema is a food foam.  For crema to form and survive long enough for us to enjoy the espresso, something needs to hold the bubbles of the foam together.  In most food foams proteins help hold up the bubbles, but in crema it is a mixture of proteins and oils. This makes it hard to predict what makes good crema.  From practice, good crema comes from:


Enough pressure and well timed extraction
Fresh grind with a good grain size distribution
Darker roasts


There are also tradeoffs between stability of the crema and the amount of crema produced. The two don't seem to go together.  The crema also should have bubbles that pop and sprinkle the coffee aromatics into the air and our noses (like champagne).  The higher pressure extraction helps extract and emulsify the oils (about 0.1g ends up in one shot).  The darker roasts help with the Maillard reaction which creates the still unknown molecules that give crema its color and volume.