In return for royalties on albums sold, the band agrees to record those albums. That seems simple enough -- it is not possible to sell albums without recording them. The contract will normally set up a group of contract periods, with each period generating an album and one or more singles.
Normally the recording contract will specify the contract periods very clearly. An amount for the advance given with each contract period will be stipulated in the recording contract, and a deadline for the album will be stipulated as well. The first contract period generates the first album, the second contract period generates the second album, and so on.
So the band goes into the studio and records an album. The contract will specify that once it is recorded, it is the property of the label in perpetuity. In addition, the contract will normally have some sort of lock-out clause with a duration of five to 10 years. This clause prevents the band from re-recording any of the songs on the album for five to 10 years after the end of the contract.
In other words, the label owns the songs you have recorded for a very, very long time.
If the label does not like the album, it has the right to reject it. In that case, the band has to record another album. Or the label can accept an album but shelve it and never release it. The lock-out clause will still apply in that case, even though the songs were never released.