To add to what IW has said,
There is also the scavenging and tuned pipe length that needs to be considered. 4-4 is the simplest setup, but 4-1 & 4-2-1 gets more complicated due to the interactions of the sound pulses up (and down) the pipe(s) and helps torque in some areas of the rpm range and hinders it elsewhere. The pipe lengths and interactions can be designed in a way to help spread torque as well.
Ideally, you'd design a pipe that sings when your in your rpm range that you want to make the most torque.
When an exhaust port opens, a pressure pulse is generated, it makes its way down to the end of the pipe at the speed of sound in hot air where it hits normal atmospheric pressure. What happens here is an inversion of the pulse takes place and travels back up the pipe towards the exhaust valve. If the cam profile, intake and exhaust ports are also breathing correctly, then during the overlap area of the cam the inlet valve has started to open slightly, so that negative pulse (a slight vacuum) will help pull in fresh charge from the intake before piston motion has even started doing any of the work. More exhaust baffling dampens/reduces the pulse and rounds it off so its less effective.
All naturally aspirated performance engines, esp formula 1 have made use of this for years to acheive the best volumetric efficiency they can get. Its poor mans supercharging.
Regarding what IW says, the concept is easily observed with a water hose with a turnable nozzle on the end. Turned to one end, you get restriction & little flow. On the other end, you get flow but little pressure. There is a happy medium in the middle where the water squirts out the furthest. So its the pressure thats doing the work, but the cross section within the restrictor has to be chosen such that the pressure remains at its highest whilst allowing maximum flow. If too much of an opening is present (like too large an exhaust pipe), then you are removing the pressures ability to create flow. This is why exhaust systems need back pressure. Too large an overall diameter also kills momentum as IW has mentioned. Lots of people end up putting pipes on that are too large and end up hurting a lot of midrange torque that would otherwise be available to them.
The same is true for the intake side. If you look at a lot of modern sportsbikes, open the airbox and you will see that the trumpets for 1 & 4 and shorter than 2 & 3. This is to spread the torque so that bike has a more linear power delivery instead of a peak in a particular area of the rpm range.
You can see from the above, that pipe design is really coupled with cam profile and this is coupled with head flow. They all go together as a system.
Didn't want to complicate the issue, but its noteworthy that there is a lot of physics involved. Anyhow, you just want to get some pipes made up so copying something that works is probably the best bet.