Well, I can't give you any two dimensional Fourier Analysis here but if I put my practical engineer hat on I can give a rough idea. A drum itself is a passive device in other words you can't extract energy from it without giving more into it. Therefore, as Dr.Mayhem's comment hints the harder you hit, the more energy you put into.
Now the moment you hit the drums all kinds of weird stuff(technically speaking here :) starts happening. The very first thing you need to catch is that the drum stick/mallet or whatever the excitation is given by needs to be taken away as fast as possible otherwise some of the energy is absorbed by the stick. So stick control is essential. When you listen to professionals and amazing greats you'll see that the stick almost never stays on the head. That's why they can sound really loud without actually banging.
After that the the drum itself is the definitive part. The material of the shell and the type of the heads need to resonate. You can think of this as pushing someone on a swing. If you wish to increase the speed of the swing you need to push the swing when it reaches the top point and stays stationary for a moment. Instead if you push early you absorb some energy yourself before the swing starts moving again. Similarly if you push too late you can't exert full force.
So that kind of interplay is essential between the material and the heads. If they work against each other, that drum would sound quieter compared to others. If they work in unison then suddenly it feels like the drums are running on amplifier.
Also the difference between a rimshot and a regular head stroke is related to this. The rim shot also excites the shell vibrational mode together with the heads hence leads to a bolder sound.
Moreover, you might want to balance your precious input energy between high freq and low freq vibrations. In other words, too low tuning would not excite the drum as a whole and the energy would be dissipated via friction due to low tension. Or too high tuning and most of the energy would be spent on high freq overtones instead of high amplitude low freq vibrations since the drum would not have any space to move.
The loudness is the amplitude of the vibration by the way. So if different waves get on top of each other you get a louder sound, if they cancel here and there you would hear complicated ringing. This is essential to any music instrument for harmony etc. so I have to skip that part.
In summary you put finite amount of energy, in turn, the drums and the sticking defines how it is dissipated. It's a different ball game to expain which wood goes with what and unfortunately it's more of an art rather than science. You might encounter some die-hard maple-birch arguers but in the end it's just physics of the head and shell.
Sorry for the vague answer but the underlying mechanism to this innocent question is really a monster to describe. You can check a lot of drum tuning videos online to see what they are trying to achieve to get some perspective.