Gallium arsenide is currently under scrutiny for replacing silicon in microelectronic devices due to its high carrier mobilities. However, the widespread use of this semiconductor is hampered by the intrinsic difficulty of producing high-quality interfaces with oxides. Indeed, proper device operation is generally prevented by a high density of interface defect states which lead to Fermi-level pinning in the band gap. The pinning of the Fermi-level is also found to occur in bulk GaAs and at GaAs surfaces upon submonolayer deposition of oxygen and other metals. Despite intensive efforts which have spanned more than three decades, the defects and the mechanisms underlying this behavior are not fully understood, thereby preventing further progress. Through the hybrid functional study of defects, we assign the origin of Fermi-level pinning at GaAs/oxide interfaces to the bistability between the As-As dimer and two As dangling bonds, which transform into each other upon charge trapping (As-As dimer/DB). Using electron-counting arguments, we infer that the identified defect occurs in opposite charge states conferring to the defect the amphoteric nature responsible for the Fermi-level pinning. In our study, we consider intrinsic defects in bulk GaAs finding a complex defect which undergoes a charge trapping mechanism similar to that of the As-As dimer/DB defect and which accounts for the observed Fermi-level pinning in radiation-damaged GaAs. Moreover, we consider oxygen defects in GaAs. Among the defects considered, we identify the one responsible for the observed Fermi-level pinning in O-doped GaAs. The computed defect properties such as the defect structure, the defect charge states, the charge transition level, and the optical transition energies show excellent agreement with the extensive experimental characterization available for this defect. These results clearly assign the origin of the measured Fermi-level pinning and optical transitions in O-doped GaAs to this O defect. In addition, we note that this O defect also shows a bistable behavior similar to that of the As-As dimer/DB defect. We find confirmation of the general occurrence of the As-As dimer/DB defect in GaAs by considering the GaAs(110) surface and suboxide model structures representing of the interfacial transition layer. Indeed, we find that both these systems show the formation of this defect, thus connecting the GaAs oxidation process to the defect formation. In particular, for the case of the suboxide models we calculate a charge transition level falling in the midgap region of the GaAs band gap in accord with the measured interfacial density of states. Finally, we address the GaAs/Al$_2$O$_3$ interface. We obtain band offsets in excellent agreement with X-ray photoemission experiments and assess that the prevalent chemical bonding at the interface consists of Ga-O bonds. Then, we study structural and electronic properties of a set of defects occurring on the GaAs side of the interface. We find that the bistable As-As dimer/DB defect can occur either as an isolated defect or within defect complexes. The calculated charge transition level and donor/acceptor character are in agreement with the experimental characterization of the interfacial density of states. This result corroborates the dominant role of the As-As dimer/DB defect in the determination of the Fermi-level pinning at GaAs/oxide interfaces.