Mastering is the last stage of audio production. Its purpose is to appraise the material from a technical point of view, to give it a final polish before duplication and in case of an album, to bring all its elements together to make them sound as a united whole.
The most important part of the mastering process is critical listening to the audio material in a room with good acoustics and on a very accurate monitoring system. In these conditions, a mastering engineer is able to pick up even minor flaws in the mix which can then be rectified before the material gets released.
Mastering entails a degree of audio processing like equalisation, level adjustment, compression etc. in order to enhance the sound of the material and optimise its translation on various playback systems. The actual processing will vary depending on the source material, client's expectations and whether it is intended for an analogue or digital replication.
Music production has undergone some major changes in recent years. It used to take a lot of resources to record material and mixing was done by a handful of highly skilled engineers. Popularisation of DAW (Digital Audio Workstation) has made the process far less exclusive and much more affordable, and there is an increasing number of people who record and mix their music at home. Some of these semi-professionals succumb to a common misconception that mastering will deal with all the problems of a bad mix. They try to shift the responsibility for the sound of their material to the mastering engineer, forgetting or simply not knowing that the formula for a technically great sounding song is as follows;
If your recording has major technical flaws it is impossible or at the very best extremely difficult to fix them in the mix. Similarly, there is very little a mastering engineer can do if a mix itself is weak. You need to record your music as well as you can and make your mix sound as you want it. Expecting the master to overcome all the pitfalls of the earlier stages of music production is futile.