Mechanical royalties are royalties that are paid to a songwriter every time a song they have written is copied, as oppposed to performing rights royalties which are paid when a song is performed (or when a recorded performance of the song is played). Generally speaking, the person responsible for paying the mechanical royalties is the person who makes the copy of the song, which means that record labels often foot the bill for the mechanicals. When a record label presses an album, then they owe a mechanical royalty to the songwriter.
The way these royalties are collected can differ a lot depending on location (different countries, different rules) and personal deals between the artist and whoever makes the copy. A common scenario is that a record label will make a payment to the mechanical royalty collection group in their country for each copy of an album they press, and then the collection group distributes the royalties accordingly to songwriters or publishers - whoever owns the copyright. In some instances, a label can pay royalties on the albums they sell instead of the total amount they press, and they can usually press a pre-set number of copies royalty free to use a promotional copies. Usually, this relationship between mechanical royalty collection groups and labels is guided by a license issued to the label by the collection group. The constraints of this license usually supercedes any side agreement made between labels and artists about the management of mechanical royalties. In other words, if you're a small label and an artist agrees to waive the mechanical royalties for their album so you have money in the coffers to promote the album, this deal is unenforcable. Mechanical royalties can be collected from labels even over the artist's objection.