The reason hydrogen bonding occurs is because the electron is not shared evenly between a hydrogen atom and a negatively charged atom.
Explanation:
Hydrogen in a bond still only has one electron, while it takes two electrons for a stable electron pair. Any compound with polar covalent bonds has the potential to form hydrogen bonds.