A bank account that is not used can be expensive. As expensive as leaving the client in question with an overdraft or even transferring all his money to the State at once. For this, specific circumstances and several notices must be given, but it is a possibility that the Bank of Spain has warned of, which has recommended that citizens, if they do not want surprises, close the accounts that are not used.
Most banks charge commissions for account maintenance and leaving them with zero euros is not the same as canceling it. Although it is true that some banks do not charge commissions if the balance is zero so as not to cause an overdraft, they could do so as established in each contract and add interest to it for being in negative figures.
In such a case, the bank must notify the client to enter the outstanding balance and send the statements to avoid major surprises when the user accesses their account. However, when there have been no movements throughout the month, it is not necessary to send the monthly summary.
In the event that 20 years pass without movement, the entity can understand that the account is "abandoned" and transfer all the money in it to the State, regardless of the amount there is. This is stated in Law 33/2003 on State Heritage, which allows this action for cases in which a state of abandonment is proven. It also happens with houses.
From the Bank of Spain they warn users to have a "correct control" of their accounts and, if they do not use any, go to the corresponding entity to proceed with their cancellation.
Also remember that to change banks, they must make the account transfer service available to customers to facilitate the procedures.