The concept behind tamping is to ensure that the grounds are evenly distributed in the basket and that there are no tiny air pockets.
The tamp is very important as water always seeks the path of least resistance; if you tamp too lightly or not at all, the water will find the areas where there are least grounds and channel through them. These areas will become over-extracted and release bitter compounds into the espresso, whilst the rest of the puck will be under-extracted, leaving behind much of the flavour. To work out exactly how much pressure to exert, practice by tamping the portafilter on some kitchen scales.
A small variation in temperature can make the difference between a great espresso and a passable one, so it is very important to ensure that every part of of your espresso machine and the water inside it are at a constant temperature.
This is why you run the water through first – it not only heats everything up, but gives consistency.
The level of moisture in the coffee grounds affects the flow-rate of espresso as the higher the moisture content, the tighter the grounds will pack. As different espresso blends contain different levels of moisture, you will need to adjust the settings on your grinder accordingly.
Also, as coffee is hydroscopic (it absorbs moisture from the atmosphere) it is a good idea to regularly monitor the flow-rate of espresso, even if using the same blend, as changes in humidity may need to be compensated for by altering the grind slightly.
Also consider how it has been stored – always use airtight containers.