Time trials (TT) are easier to study than mass start races, where team tactics, skill, experience, drafting benefits, and other hard to measure variables easily cloud the picture. TT studies can be found in many publications and I won't repeat them here except to highlight a few rather self-evident facts. You may wonder why someone would care about things that are self-evident, but in this day and age there is so much information (read advertising) out there that many people forget the basics.
Not surprisingly, training provides the biggest gains, exceeding those of lighter bikes, aerodynamic frames, and other gadgets. Furthermore, the less "base" you have, the bigger the effects of training will be. If you are an experienced cat 1 cyclist, training will help but not nearly as much as when you are a novice or rookie. Still, elite riders can expect as much as 3% gain from a good program. That is certainly significant enough to make a difference. One would expect the gains of training to be even bigger for longer distances. Clearly, a 100+ mile ride requires training. You cannot "buy" your way into such an event.
Weight matters but only when you climb. You need to do a fair amount of climbing before you can see the benefits. For a short 25 mile time-trial, that means you need a pretty steep average grade, well in excess of 5%, but over a distance of 112 miles, things add up rather quickly. When it comes to weight, every little elevation change matters. Those numerous 15 ft "bumps" on the road may not show on the map, but when you add them all up, they can easily become a serious climb by the time you are done.
The best way to reduce bicycle weight in a race is not to buy a lighter frame, but to watch what you lug around. First take a look at your saddle bag. There is no need to carry a laptop computer with you in a race. There is also no need to carry enough supplies to cross the Kalahari in summer.
Two large full water bottles will add 3 pounds (1.3 kg), more than many frame fork combinations. While that may make sense on a long training ride in the hot sun, it is rather silly in a race or event, where you can get fresh, cold water every 10 miles or so. Grabbing a bottle will not slow you down significantly once you learn how to do it properly. But carrying extra weight will not just slow you down, it will also tire you out.
On the flats, aerodynamics matter the most. In mass start events, that means drafting. While most people can draft in a headwind, few seem to understand that you need to ride in a echelon to draft in a crosswind. This obvious fact seems common knowledge in Europe, but it is rare to see American riders ride that way. For time-trails and triathlons you need to resort to aero equipment as drafting is not allowed.
The gains from a proper aero position and frame can be quite significant. Some estimates for a 40K TT are as high as 2.5 minutes. Furthermore, these gains tend to be the same irrespective of your level of training. First and foremost, good aero means nothing flaps around in the wind. Watch that race-number. You can easily waste 10-20 W! That is a huge drag, even for an elite cyclist. The second thing to watch out for is items stuck to your frame. That $5 pump can easily nullify the gains from a $3,000 frame. If you "need" the pump, then be sensible enough to save the money on the frame.
Lastly, it may surprise some, but caffeine, the only legal performance enhancing drug saves anywhere from 1 to 1.5 minutes over a 40K distance. That is more than half as much as your aero-frame, at a much better price point.
Sugary drinks help too, but much less so. When it comes to sugary drinks (or carbohydrates), there is no significant difference between the various brands. Just as long as you supply the calories. In general, you should not exceed 300-400 calories per hour as that is the limit of what people can absorb in a race. There is little benefit from "long-acting" or "slowly digesting" carbs during a race. You need the energy right then and there. During a race is not the time to start storing energy or digesting food.