We have investigated the electronic structure of several intermetallic compounds of AB and AB(5) type and their hydrides using the ab initio self-consistent Linear muffin-tin orbitals method. The energy bands, total densities of states as well as their site and partial wave contributions are used to discuss the metal-hydrogen bonding features, the modifications of the electronic states at the Fermi energy on hydrogen absorption and the factors which control the stability. The specific systems investigated are zirconium-based AB compounds (A=Zr, B=Co, Ni) and their hydrides ABH and ABH(3),. We also discuss the effect of substitution at the Ni site in LaNi5 by several elements of the 3d series (Mn, Fe, Co). In Zr-based AB hydrides, the Zr-H bonding contribution is crucial to the stability of the system due to the lowering of the energy states below the Fermi energy. The total energies of ZrNiH calculated for different site occupancies by the H atoms are in agreement with experimental trends. Far the intermetallic compounds LaNi4M (M=Mn, Fe, Co) the Fermi level is found to lie in a narrow M-3d sub-band above the Ni-d states, and the densities of states are high. The lattice expansion accounts for less than 50% of the decrease in the stability, indicating the importance of the chemical substitution effects, besides the lattice expansion contribution. For the Co-subtituted compound, the (3g) sites are found to be more stable than the (2c) sites, in agreement with experimental observations, and the maximum hydrogen content of the hydride LaNi4CoH4 appears to be associated with the filling of the Co-d peak. (C) 1999 Elsevier Science S.A. All rights reserved.