The electronic structure of LaNiSn and NdNiSn compounds and their hydrides has been studied by first principles calculations and variable temperature 119Sn Mossbauer spectroscopy and the nature of the hydrogen-metal bond is discussed. The analysis of the electronic density of states (DOS) in both compounds before and after hydrogenation indicates an hybridization of the Sn, Ni, and H orbitals. The partial Sn-p DOS of LaNiSnH2 gives evidence for a lower symmetry of electron density around tin atoms compared to LaNiSn, according to the larger quadrupole splitting in the corresponding Mossbauer spectrum. Theoretical and experimental Mossbauer parameters agree very well for all samples.