An IBAN contains information that you can use 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.
On the other hand, most banks use an IBAN checker (an IBAN lookup) to ensure that valid IBANs are free of errors.