The situation is similar to a speaker cabinet with a separate hole in the baffle. Speakers move air by moving backwards and forwards. There is a 'push' of air as the cone moves forwards, and also a 'push backwards' as it moves back. The air in a normal enclosed cab goes nowhere, but in a ported cab has a chance to 'push' through the port (separate hole). This adds to the volume and changes the tone of the sounds the speaker produces.
On a guitar, the vibrations of the strings move through the bridge (and any other points of contact) as well as through the air to the nearest next point of vibration - the body. This then vibrates and amplifies the sound. Like the speaker analogy, the air needs to escape to be heard better.This is a non-scientific approach to the answer, but a scientific one would consider the paths of sound waves, their direction through the guitar, and where on its body would be the optimum place/s to let the sound out. With various parameters - type of wood, contour of shape, size, etc. Given that all these are equal,which is almost an impossibility in itself, it's still extremely difficult to define the best place for hole/s.But their positions will certainly affect the sound quality and volume. Not always for the better !