Snoopay700 explained it quite well.
Ideally, you want to open the valve and have all the available measured volume of air hit the projectile without having to flow through any restriction. It would then come down to a decreasing volume of air providing a decreasing force as the volume behind the ball increases. As the volume increases, when the force due to air pressure equals the force of friction, then you have reached your proper length of barrel for max efficiency because no further acceleration will take place. Allowing for friction of the barrel also means that higher pressures will deliver the best overall efficiencies due to the smaller starting volume not allowing the overall volume behind the ball to decrease as quickly. Once the volume increases such that the pressure and resulting force is equal to the friction, then all air in that volume no longer produces acceleration. The smaller the percentage of volume used to store the energy means that volume won't be used to store energy that can't be used to provide acceleration and more is actually applied to the ball to provide acceleration.
What does this mean for most paintball markers? It means you need a large unobstructed opening between the chamber and ball, and it needs to be able to open quickly. This is part of the reason mags aren't as efficient as some other markers. The valve opens and closes too slow. We compensate by using a higher pressure to allow a "pop" of air which is less affected by the flow restrictions of the slow reacting bolt/valve. If all paintball guns used
higher pressure chambers, they could achieve even more efficiency, but I'm not sure it would be worth the cost of the parts required to harness the higher pressure. But the guns would be even smaller than they are now.
Except for the Automag in front, its usually the man behind the equipment that counts.