Horns are very good at matching impedance. This is the bottom line of why they are so loud.
To expand. Most sound producing devices couple their energy to the air very poorly. The problem is that a vibrating mass - like the wooden top to a violin or guitar, a vibrating speaker cone etc, is made of a dense (relative to the air) material, and almost all of the energy you put into the system is spend making the radiator move, and very little of the energy couples into the air. The difference in material properties that matter are their impedance - and the thing that matters is that when you have a difference in impedance between the materials, you don’t get good energy transfer. The bigger the difference the worse things are.) A horn provides a gentle constant change of impedance along its length, matching the open air at one end, and a much lower impedance at the small end, which allows the actual sound source - the lips blowing out air - to couple better to the air in the horn.
The horn has resonant effects that make the whole production of a musical tone work well, and that helps the initial sound from the lips to be loud in the first place, so you get a double benefit. The sound from the lips isn’t just the feeble sound of someone blowing a raspberry, it is energising a resonant system, and that is also going to become much louder. The lips see rising and falling pressure in the horn throat that acts to make the lips vibrate at the frequency of the resonance, and thus put energy at the required frequency into the system. Controlling these resonances is the art of playing the horn, and (especially for a natural horn) part of how you play different notes.
For things like speaker systems, the important bit is the impedance matching function of the horn. Horns tend to be pretty directional at higher frequencies as well, so that helps further, although typically you try to design the horn to have a good spread - the wider the end of the horn the better here.