It’s a stall. When the plane is like that it’s nearly impossible to maneuver because the control surfaces aren’t exposed to airflow so they don’t do anything. Your only hope is to somehow make it face the ground again and pull up in time.
As to how it got that way it usually happens when someone loses track of the horizon and tries to fly up.
Legit bit of code I saw once
getRandomColor() { Random.seed = 0; return Color.blue; }