There are good answers here, I want to add a few main things when considering speed/acceleration like you’re talking about. 1st off the weight of the vehicle plays a huge part, generally performance cars are using materials like aluminum and carbon fiber to reduce weight where they can. Second is drivetrain (motor transmission axles) these can all be made lighter/ more durable / more efficient. 3rd I’ll use an example I have a 1989 325i it has a 2.5L 6 cylinder engine. The sportier version of my car the M3 has a 2.3L 4 cylinder engine. You might think that because my car has a larger engine it will be faster but because of those points I made earlier such as lighter weight, quicker shifts, or more efficient parts it is actually much much faster than the 2.5L
Latest Answers