Why does a sound get louder if it’s played twice at the same time?
If by “played twice at the same time,” you mean like if the same song is played through two Bluetooth speakers, or if two people are singing the same melody, it may be related to something called ‘constructive interference.’
Interference is how two or more frequencies, like sound waves, behave in the presence of each other. If those waves from different sources are in sync to one another, their overall effect will be amplified and perceived as a louder volume. That’s what the ‘constructive’ part of it means, they build each other up.
The same reason a room is brighter if you turn on 2 lights vs. 1 light. Why is this a mystery?
The question has mostly been answered, but a little interesting detail:
Imagine for simplicity sound waves as waves on water or a simple sine wave. They have highs and lows, in a regular pattern. If sound meets, those waves are added up. If both waves have the same highs and lows they add up, making them louder. This is called _constructive interference_; if the highs of one meet the lows of the other, and vise versa, we get _destructive interference_, their loudness subtracts. If they have different frequencies (= the distance between two highs/lows), or if they are not aligned as in the above cases, they lead to a complicated pattern.
However, the (temporal) position of those peaks depends on your distance to the speaker, as sound only moves ~1km every 3s. Thus if both speakers play exactly the same sound and you sit precisely in the middle, they will again add up. If you sit elsewhere, you get _interference patterns_, maybe you were shown the light version from the double slit experiment once.
Thus if you move around this will shift the relative position of the highs and lows. For a 100Hz sound, the distance to turn constructive into destructive is roughly 1.6 meters, so it maybe gets notable when the distance differs by at least 50cm. For 1000Hz it goes down to 16cm, which is about the distance between your ears. I am unsure how hard it is to make it noticeable, likely things are easier if disabling one ear.
Adding two sound waves together will double the height of the wave, which doubles the intensity of the sound.
Active noise-cancelling headphones work by sensing external sounds and gently playing the opposite into your ears.