The difference in level between the loudest (highest level) parts and the lowest level parts of a recoding is called the “dynamic range”.
Reducing that difference is called “reducing the dynamic range”.
Effects that reduce the dynamic range are called “compressors” or “limiters”. Both compressors and limiters do similar things, they both reduce the dynamic range, but they work in slightly different ways.
A limiter works in a similar way to what you have been doing manually. It looks for peaks that are above a specified “threshold” level, and reduces them.
A compressor is similar, except that rather than just reducing the peak, it works by adjusting the level more gradually.
There is a limiter plug-in available here that you can try (the one marked “New Version”): https://forum.audacityteam.org/t/peak-limiter/20300/1
Instructions for installing: http://wiki.audacityteam.org/wiki/Download_Nyquist_Plug-ins#Installing_Plug-ins