Alot of things, factory exhaust systems usually have very restrictive muffler(s) that have baffles which direct the exhaust gases through different size openings, screens and chambers. On top of 1 or more mufflers, there is often resonators as well. Resonators do exactly what the name says, they resonate or help reduce/eliminate certain exhaust frequencies at certain RPM's. This helps when it comes to the dreaded exhaust "drone" you get at higher RPMs. Another factor is just purely the exhaust diameter, albeit far less than the mufflers/resonators.
When you get a system louder than stock, it usually had a different resonator and/or different type of muffler. Resonators are not always on aftermarket systems or may just be an option. Mufflers tend to be more "straight through" style to increase sound or less baffles/chambers to do the same.
Hope this helps!