What makes one bike faster than another when same wattage is applied? I have two bikes.  One is a $7k+ Cervelo S-Series, and the other is a &lt;$1K Trek Domane AL 2.  With the same perceived effort applied, my Cervelo goes much faster.  I am able to routinely hit above 20mph mark with ease, whereas with the Trek, I struggle even to get up to 17/18mph.  The Trek is noticeably more difficult to ride.  I feel like I need to apply so much more effot to the pedals in order to get the bike to move.  I would like to upgrade the Trek so that for any given wattage, it goes faster.
My question is, what exactly is making the Trek so much slower than the Cervelo?  A few things come to mind.

Aerodynamics
Weight
Rolling resistance.

The Cervelo is more aerodynamic, but it doesn't seem like the resistance I feel is because of aerodynamics.
The Cervelo is lighter, but only by 3.5 lbs.  Again, doesn't seem to be the biggest culprit.
I have Continentall GP 5000 tires on the Cervelo, and just the stock basic Bontrager tires on the Trek, so that could be part of it?
For me, it seems like the Shimano Claris groupset is the biggest culprit.  It feels very clunky.  Would upgrading to a Shimano 105 be something to consider for this bike?
Most likely aerodynamics.  Modern road bike vendors spend a lot of money improving the aerodynamics, especially for the racing top models. Mor for the so-called aerobikes, but even for the ultra=light bikes, up to the point the weight permits.
The weight is not too important on the flats and is less important than many think even in the hills as most of the weight is in the rider anyway.
Tyres will make some of the difference too. Obviously, top ricing tyres will be faster on smooth tarmac. I made a big improvement from the stock Schwalbe tyres to better G-Ones on my gravelbike. But aerodynamics of modern bikes cannot be beaten by tyres, the differences are usually smaller there.
The groupset may be more clumsy when shifting but when the gear is there, it does it job very well. If you want more gears and have the money (which you probably have if you have the Cervélo S), you can buy 105, it will be lighter, but do not expect to be any faster on flats. (I ride Claris regularly. Some would miss the gears, the shifting requires some power in your hands, but otherwise it does the job done well enough.)