The bonds that connect them are the main difference.
Explanation:
[tex]Li_2O[/tex] is an ionic compound of ionic bonds, with a metal ([tex]Li[/tex]) and a nonmetal. They are together through an electrostatic fragile connection that can be undone resulting of [tex]Li^+ + O^{2-}[/tex].
[tex]HCl[/tex] is a molecular compound formed with covalent bonds, with two nonmetals. They are together sharing the same electron filling their valence shells, which makes this bond very stable.