The process of making espresso in it's most simple form is water running through ground coffee beans.
If the water runs through the grounds too quickly from the grounds being loosely tamped, it won't extract any espresso or the final shot will come out watered down.
On the other hand, if the espresso grounds are packed too tightly, water flow is impeded resulting in a bitter shot from a long extraction time. Even worse, the water may not even make it through the grinds.
Getting an uneven tamp can cause problems as well. It will cause the water to move quicker to one side than the other resulting in an uneven extraction of your ground beans. It can also result in channeling.
The tamper is main tool that the barista has at their disposal to make sure that the grounds are packed correctly. Along with grind coarseness, the tamp is the other major variable in the equation of making a consistent and delicious espresso shot.