In this clip, we see a fighter performing risky manoeuvres at very low altitude around a densely populated civilian area.
What authorization would have been required for this and why would it be granted?
The portion of the video you linked to indicates that it takes place in Australia and the scenery seems to match. This means that the Australian Civil Aviation Safety Authority would be in charge of approving such flights. They provide a manual that describes air display administration and procedures. Other countries likely have similar procedures for authorizing such flights.
To summarize, the organizers of the event must identify individuals responsible for the safe execution of the event. They must complete a detailed risk assessment for the air displays along with plans for dealing with these risks and responding to emergencies.
For actual practice, which can be seen at points later in the video, they absolutely do use much more remote areas where the risk to the public is much lower. There are general rules for maintaining distance from people and structures, and pilots can and do face revoked licenses and jail time for blatant violations.
To your point about "almost stalling," it looks like the pilot is intentionally unloading the wings from the tight turn before rolling to pitch up, which actually helps to avoid a stall.
Per the manual, someone must be designated as the Display Organiser, with responsibility including event site and display management:
In addition, "reasonable steps must be taken in the planning and execution of the event to provide safe outcomes."
There must also be a Display Coordinator that specifically takes responsibilty for the airborne displays:
The Display Coordinator is responsible for: