Libraries pay higher rates for ebooks than the retail price. They have to renew the license. A publisher can choose not to license their ebooks to a library if they want. Each license can only be lent to one person at a time and there are usually time limits.
In other words, it's completely different in every way.
Not taking any stances here, but the difference is a library book can only be used by one person at a time, and it eventually wears out and has to be replaced.