Praise be to Allah, the Lord of the Worlds; and may His blessings and peace be upon our Prophet Muhammad and upon all his Family and Companions.
If the lender puts a condition on the borrower that if there is a delay in returning books the latter has to pay a given amount on each delayed day.
This is a retributive conditioning and it should be met. In principle, the conditions are permissible, unless they allow that which is forbidden or forbid that which is allowable. The said condition has nothing to do with this, so it is legitimate.
Al Bukhari reported in his Sahih that Ibn Sirin narrated that "a man said to a hirer: get your camel ready. If I do not travel with you on such and such day, I will give you 100 Dirhams. Finally, the man did not travel and Sharih told him: "whoever puts a condition willingly on himself without being forced, and then he has to fulfill that condition."
Al Hattab, a Maliki scholar, stated in his book, iltidhamat' that if a wife puts a condition on the marriage contract that if her husband marries a second wife, that he should pay a given amount of money to her, then the condition is correct and the husband has to fulfill that condition.
If he remarries, he has to give her the money stated in the condition. The retributive conditioning is correct, and the person has to pay the conditioned amount to the conditioner when failing to fulfill the condition.
Many scholars and fatwa centers and institutions are of the view that this retributive conditioning is permissible. The condition stated in the question is for a benefit, because many book-borrowers if they are not bound by this retributive condition will be negligent in returning the books, as is common today, and this causes harm to others who want to benefit from these books.
Therefore, if this is the case, there is no interest or usury in fulfilling this condition. Interest or usury, as it is known, is an additional charge stated in the condition on the capital money borrowed for a given time-period.
Retributive conditioning is not related to this. However, we draw your attention that it is not permissible to charge interest on the fine if you delay in paying it, as it will then be considered as usury.
Allah knows best.