Firstly, whether the coffee is relatively fresh – the longer ago it was roasted, the less carbon dioxide it will contain so the less foam it will produce. And secondly, whether the cup of espresso is strong or weak. The darker in colour the foam, the stronger the liquid will be.