Mastering is essentially the step of audio production used to prepare mixes for the formats that are used for replication and distribution.
...
The mastering engineer picks up where the mix engineer leaves off. Mastering is geared toward creating the balance required to make the entire album cohesive. The mastering engineer is most concerned with overall sonic and translation issues. A mastering engineer works with the client to determine proper spacing between songs and how songs will be ordered on the CD.
...
Any final edits will be addressed during the mastering process as well.
...
Finally, the role of the mastering engineer is to provide preparation and quality control of the physical media send to the plant for replication. This includes listening to the premaster CD to verify integrity, along with the more technical aspects such as encoding text, UPC/EAN and ISRC codes, checking for errors within the media and providing any necessary documentation such as a PQ list.