These words are unrelated: they developed independently from different Proto-Indo-European roots, according to Michiel de Vaan's Etymological Dictionary (337–38).

First, liber or librī, meaning "book," is thought to come from a PIE word meaning "leaf, rind": *lubʰ-ro-. De Vaan cites several Indo-European languages that have attested cognates and summarizes:

We may surmise that liber is cognate with *lubʰ- and goes back to a PIE word or a European word 'leaf, rind'.

On the other hand, līber, meaning "children," comes from a different PIE word (*h 1 leudʰ-ero-), through a Proto-Italic word *leuþ-ero. The word also means "free," and the "children" meaning developed later. De Vaan explains again:

The change of the pl. līberī to 'children' is explained by Benveniste from legal terminology, in which the legitimate 'children' of a free couple were denominated as 'free ones'.

So it's simply a coincidence that these words ultimately came to look very similar: they developed from distinct PIE roots.