Electron-hole (e-h) compensation is a hallmark of multi-band semimetals with extremely large magnetoresistance (XMR) and has been considered to be the basis for XMR. Recent spectroscopic experiments, however, reveal that YSb with non-saturating magnetoresistance is uncompensated, questioning the e-h compensation scenario for XMR. Here we demonstrate with magnetoresistivity and angle dependent Shubnikov - de Haas (SdH) quantum oscillation measurements that YSb does have nearly perfect e-h compensation, with a density ratio of $0.95$ for electrons and holes. The density and mobility anisotropy of the charge carriers revealed in the SdH experiments allow us to quantitatively describe the magnetoresistance with an anisotropic multi-band model that includes contributions from all Fermi pockets. We elucidate the role of compensated multi-bands in the occurrence of XMR by demonstrating the evolution of calculated magnetoresistances for a single band and for various combinations of electron and hole Fermi pockets.