In an ideal world, if you were only looking at performance, there would be a short exhaust with no filters. That would be the best thing for the engine, but that’s going to be terrible for the environment.
The less resistance the flow of exhaust meets going from your engine outwards, means the better the engine can operate. But we need a catalytic converter to help purify the air, and a longer exhaust to cut down on sound pollution.
So an exhaust kit meets these things in the middle, or tries to. It is usually wider in diameter to open up the flow of exhaust so your engine uses less energy.
If you’ve ever seen a really short and loud exhaust, maybe angled under a door instead of extending all the way to the rear of a vehicle, now you’ll know why they do it!