The bank uses an IBAN to verify your account number, the country of origin of your bank, and other account details.
When you make a payment, the code is compared to the IBAN register to ensure that the receiver is correct.
If an IBAN is entered incorrectly and there is no account corresponding with that IBAN, the transaction will fail. If a corresponding account exists, the transfer will go through and can only be reversed with the recipient's permission.