We review the history of the self-gravitating Fermi gas in Newtonian gravity and general relativity. We mention applications to white dwarfs, neutron stars and dark matter halos. We describe the nature of instabilities and phase transitions in the self-gravitating Fermi gas as energy (microcanonical ensemble) or temperature (canonical ensemble) is reduced. When N < N OV , where N OV is the Oppenheimer-Volkoff critical particle number, the self-gravitating Fermi gas experiences a gravothermal catastrophe at Ec stopped by quantum mechanics (Pauli's exclusion principle). The equilibrium state has a core-halo structure made of a quantum core (degenerate fermion ball) surrounded by a classical isothermal halo. When N > N OV , a new turning point appears at an energy E c below which the system experiences a gravitational collapse towards a black hole [P.H. Chavanis, G. Alberti, Phys. Lett. B 801, 135155 (2020)]. When N OV < N < N * , the self-gravitating Fermi gas experiences a gravothermal catastrophe at Ec leading to a fermion ball, then a gravitational collapse at E c leading to a black hole. When N > N * , the condensed branch disappears and the instability at Ec directly leads to a black hole. We discuss implications of these results for dark matter halos made of massive neutrinos.