A tamper compresses loose coffee grounds, creating pressure on the grounds. During brewing, pressurized water from the espresso maker comes into contact with the tamped coffee.  Tamping is necessary because there needs to be a minimal amount of space between the machine’s filter and the part where the pressurized water exits the machine.  Without tamping, there won’t be enough space for the water to saturate the grounds properly, and the flavor will be affected.