Are you talking about the amazon library or an actual library that lends you ebooks? I'm assuming the latter, in which case you just plug in and transfer.
Actual library that lends me ebooks (Austin). The library uses Overdrive (Libby) and anything provided in the Kindle format can't be downloaded directly from the Library's interface. You have to click a "Read now with Kindle" button which redirects you to Amazon, where you have to click "Get Library Book" directly from Amazon.com.
Epub can be downloaded directly from the library, but these have to be converted into a Kindle compatible format. I'm also unsure if every digital book copy has Epub as a format, since there are some digital copies that don't have Kindle format.
This has been true of all public digital libraries I've used in the past 10 years (Houston, Arlington, Fort Worth)