The basic idea of sizing is to balance two things, flow velocity and pressure build up.
Essentially you want as high a non turbulent or laminar flow as possible, but bends merges changes in cross section also affect this
then there is the other aspect, acoustic tuning, A properly designed set of headers can generate a nice strong rarefaction signal at the exhaust valve at TDC compression, w/ the right cams this vacuum signal sucks additional mixture into the combustion chamber yielding extra torque & hp.
The strength of the rarefaction signal is proportional to the change in cross section area of the pipes, there can be be more than one signal if here is more than one change in cross-section area, the bigger the cross-section delta the stronger the signal, to get the best result the collector must be open to atmosphere or to a set of tapering megaphones which add additional tailoring to the signal depending on their geometry. W/ a muffled system most of this acoustic tuning component is lost due to the reduced cross-section area of the transitions from pipe to muffler, the distance from the cross-section delta times the delivery of the rarefaction, hence the concern about pipe length.
unfortunately what works great at low rpm falls on it's face at high rpm and vice versa.
similarly using too small on a big engine works great at low rpm not so much at high rpm
on a muffled system the acoustic tuning aspect is mostly not there so flow is the primary concern, though small gains can be made they are small and hard to come by
an example is seen in 993 mufflers where the factory on the n/s mufflers arranged for s large a cross section change as space allowed inside the muffler
The turbo mufflers on the other hand are solely concerned w/ flow so they use perforated pipe, which is only slightly less efficient in the flow department
the physics of gas flow says that bends and changes in diameter and the geometry of those changes all affect flow velocity and turbulence, hence fewer bends w/ longer radii, and carefully arranged merges, an attempt to retain heat is often implemented as well, higher temp gas flow faster.
911 engines are blessed w/ a favorable firing order which leaves plenty of room between pulses, though residual pressure never goes negative the reduced pressure between pulses does help to speed flow