The reason you want all the separate pipes on the header to be the same length is this:
You don't have a continuous flow of exhaust gas going out of the cylinders; you have a pulse of exhaust coming out on each exhaust stroke. Having the pipes the same length means that the time delay between the pulse leaving the head and hitting the collector is the same for all four cylinders, so they hit the collector in an evenly-spaced pattern the same as how they left the cylinder. This makes the car sound better, and it also runs a bit more evenly.
There are also some tuning effects. They're simpler to explain on straight pipes, though. When a pulse of exhaust hits the end of an exhaust pipe, it sort of reflects as a "negative pulse" of negative pressure going back the other way, and if the pipe is the right length for the speed the engine is running, that negative pulse will hit the cylinder head just as the exhaust valve opens for another stroke, and it will help pull the exhaust out of the engine and give you a touch more power. (The same thing in the other direction is why some cars had really tall injector stacks on the intake.) Similar but more complicated things happen where the four pipes of a header meet the collector, and you want all four pipes the same length so that the same effects happen to all four cylinders the same amount, for balance. That also means long-tube headers will perform a little differently from short-tube headers.