I hereby copy a very nice statement from the conclusion of Illy & Navarini's survey paper:
Most of the data reported in the present review may suggest that espresso brewing can be described as “a quick way to transfer carbon dioxide from roasted and ground coffee to a small cup by means of hot water under pressure”. This then leads to the facts that for espresso coffee, carbon dioxide has to be:
generated by roasting
maintained in the bean by proper packaging
maintained in the ground coffee
solubilized in water
released into the beverage.
In this framework statements such as “any error in grinding or in percolation, in temperature or extraction level, has an immediate effect on denounced by the color, the texture and the persistence of the foam” or “the foam is the signature of a well-prepared espresso” can be well justified. In fact, foam volume, persistence, and consistence are the consequences of the carbon dioxide content originally present in the coffee. In addition to the importance of carbon dioxide in espresso coffee foam, we believe that carbon dioxide can play a role even from a taste point of view.
Therefore; you need to find fresh nice Arabica beans, roast properly, degas for the correct amount of time, grind them well, brew appropriately with decent water right after grinding.
Note: Please see this discussionthis discussion for the use of the percolation in scientific papers. It simply means brew.