  Magic-angle twisted bilayer graphene (MATBG) is notable as a highly tunable
platform for investigating strongly correlated phenomena such as high-$T_c$
superconductivity and quantum spin liquids, due to easy control of doping level
through gating and sensitive dependence of the magic angle on hydrostatic
pressure. Experimental observations of correlated insulating states,
unconventional superconductivity and ferromagnetism in MATBG indicate that this
system exhibits rich exotic phases. In this work, using density functional
theory calculations in conjunction with the effective screening medium method,
we find the MATBG under pressure at a twisting angle of $2.88\unicode{xb0}$ and
simulate how its electronic states evolve when doping level and out-of-plane
electric field are gate-tuned. Our calculations show that, at doping levels
between two electrons and four holes per moir\'{e} unit cell, a ferromagnetic
solution with spin density localized at AA stacking sites is lower in energy
than the nonmagnetic solution. The magnetic moment of this ferromagnetic state
decreases with both electron and hole doping and vanishes at four
electrons/holes doped per moir\'{e} unit cell. Hybridization between the flat
bands at the Fermi level and the surrounding dispersive bands can take place at
finite doping. Moreover, upon increasing the out-of-plane electric field at
zero doping, a transition from the ferromagnetic state to the nonmagnetic one
is seen. We also analyze the interlayer bonding character due to the flat bands
via Wannier functions. Finally, we report trivial band topology of the flat
bands in the ferromagnetic state at a certain doping level.
