A thin interlayer of an early transition metal, e.g. titanium, can enhance the bonding at a metal-ceramic interface considerably. The role of the electronic structure in this phenomenon (the `titanium effect') is studied quantitatively by means of density functional calculations, employing norm-conserving ab initio pseudopotentials and a mixed basis of localized functions and plane waves. The weakly bonding model interface Ag(100)/MgAl2O4(100) is chosen, in order to minimize the lattice mismatch and to concentrate on electronic interactions. The stepwise addition of Ti atoms at the interface from zero to one monolayer of Ti leads to a pronounced enhancement of the bonding strength (Ag/Ti/MgAl2O4). From a comparison to the more strongly bonding systems Ag/Al/MgAl2O4 with a monatomic Al interlayer and Al/MgAl2O4 it is concluded that this enhancement correlates with the reduction of the electron density in the interface layer. It is proposed that the interlayer accommodates Pauli repulsion between O anions and electron-rich Ag atoms by suitable electron redistribution, which is accompanied by pronounced energy band shifts.