The port and box together make a resonator, which (properly tuned) extend the bass, typically by a half octave. There is no free lunch, so the price you pay is a faster rolloff below the lowest useful frequency.
What happens is, the mass of the air in the port resonates against the stiffness of the air in the box. Much the same as a coke bottle, and different from an organ pipe or clarinet.
Google "ported box speaker design" and you'll find plenty of sites.