I'm surprised by all the comments in this thread saying that you have to physically go to your library during their open hours to borrow a book. Most libraries I know offer digital downloads through the Overdrive app.
I regularly borrow audiobooks and ebooks from the library with a couple of taps on my iPhone.
Yes, but they don't allow an unlimited number of patrons to read the book at the same time. You have to get in line. At my library, the wait time for popular ebooks can be more than a month. And once you do get to check out an ebook, you only have it for a couple weeks, then you have to "return" it, and if you want to read it again/more, get back in line.
That's clearly inferior to Amazon's service where you can read any book in their catalog at any time, even if a million other Amazon customers are simultaneously reading it, and you can open it and read it as often as you want, with no waiting.
I borrow ebooks from my library quite often, but I also buy a ton of books for my Kindle, for similar reasons as above, and will most likely subscribe to Kindle Unlimited (depending on the catalog — right now the catalog looks like a few bestsellers I've already read or don't care to read, plus several hundred thousand self-published romance novels).
I regularly borrow audiobooks and ebooks from the library with a couple of taps on my iPhone.