Coffee tamping is the action of compacting ground coffee in an espresso portafilter with a tamp, prior to brewing.
A tamp can be either handheld or attached to the espresso machine.
A handheld tamp normally has a wooden handle and a stainless steel face which is the same size as an espresso portafilter.
Professional baristas will typically use a handheld tamp, which allows for a better angle and a more successful tamp.
To properly tamp espresso, the tamp should rest evenly on the coffee bed in the portafilter. Pressure should then be applied evenly and firmly to the coffee bed. Tamping unevenly at an angle, for example, would be considered a common error when tamping. Another error would be either not adding enough pressure or adding too much, namely undertamping or overtamping.
The action of tamping adds resistance to the coffee bed which makes it harder for water to pass through it. Espresso is therefore brewed at higher pressure, which is the defining characteristic in espresso brewing.