Translation:I borrowed books from the library.
By saying "THE books" you're making them the topic of your sentence. If that were the case in Japanese, they'd be marked by the particle は. E.g.「本は図書館からかしました」.
In the current sentence the emphasis is more on the act of borrowing with "a book" or "books" (more general) being of secondary importance (marked as direct objects)
I don't think you can use に in this one. You use 〜に本を借りました when you borrow from a person (ex. 友だちに本を借りました but also 友だちから本を借りました is used), whereas から is used when you borrow from a place etc. If you want to say you borrowed a book at the library, you'd say 図書館で本を借りました because 借りました expresses an action. You use に to indicate the place of a happening when the verb is static, like いる·ある. I don't mean a direction