In a perfect set up, if there is no wind resistance, no friction, etc. etc., then both would have the same kinetic energy -- the same kinetic energy you stored in the spring when you cocked the gun. The energy output of the spring is relatively constant. The gun is just throwing pellets of different weight with the same strength in its throwing arm. And yes, the kinetic energy goes up as a linear function of the mass of the projectile and goes up exponentially with the velocity of the projectile. That is, if you double the "weight" of the pellet, at the same velocity, it has twice as much kinetic energy as the lighter pellet. But if you double the velocity of the same weight pellet, its kinetic energy goes up by a factor of 4 ("velocity squared").
The gun accelerates the the less massive pellet more easily, to a higher velocity, because the pellet has less inertia (mass). But you pay the price down range. The air resistance decelerates the less massive pellet more efficiently for the same reason. And . . . if the piston power plant produces a constant energy in terms of pressure in the tube (ie, pounds per square inch) at the back end of the barrel, then there is relatively more force (PSI) pushing the larger pellet because it has more surface area (sq inches) for the expanding gas to push on.
Think of it like squirting water out of a garden hose. Restrict the end of the hose with a nozzle and you will get a very fast jet of water (high velocity), but at a price - less volume of water coming through the nozzle per unit of time. Now, think about (but don't) dry firing a springer. Restrict the bore of the rifle to 177 and you will get a faster jet of air (higher velocity) but the total volume of air can't come out as quickly, so some efficiency is lost. A larger 22 bore, same spring/piston will give less potential velocity but it pushes the total volume of compressed air (ie, stored energy from the spring) out the barrel more efficiently. It's ike filling a bucket from a garden hose. Is it going to fill more quickly with a jet spray of water or with just the open end of the hose pouring a larger, slower stream of water? A large hose delivers water more efficiently, albeit at a lower velocity. Or think about it this way -- you are always limited on how quickly even the most powerful spring/piston can deliver it's total stored energy (volume of compressed air) through a smaller bore than a larger bore. The velocity of the pellet isn't limited, but the total amount of energy imparted by the compressed air available is limited.
I suspect the tuning gurus know this intuitively and work at getting the spring/piston to deliver just the right volume of air at just the right pressure optimum for the caliber of the airgun.