The art of football. This is one of those unwritten things. If there's a 0-0 late goal, then time gets added on. In a draw or one goal difference the referee is stricter about added time for stoppages, including dithering in added time, and additional stoppages in added time. If there's a clear leader by 2 or more goals, then it's minimum added time and the bar for adding more is very high.
This is one of the things where the referee is responsible for the spectacle. Just like allowing defensive free kicks or offside free kicks to be taken from the wrong place. It's part of the art of football. And part of the culture of football that helps generate so many column inches