You have a goal time and a gap to close. The natural instinct is to train more of whatever you enjoy most. The better question is where the next hour of training buys the most minutes on race day.
The maths of percentages
Take a half-distance race finished in about five and a half hours, as an example. Say 40 minutes in the water, a bit under three hours on the bike, a bit under two hours on the run, plus transitions.
One percent faster on that bike is close to two minutes. One percent faster in the water is about 25 seconds. The bike is the longest leg, so small gains there add up to the most time. That's true at every distance from Olympic (Standard) up.
That doesn't make the bike the answer for everyone. It tells you the size of the prize, not the price. The price is how much training it takes to get that one percent, and that depends on where you're starting from.
The swim: cheap if technique is the problem
For a lot of triathletes who came to swimming late, the swim isn't limited by fitness. It's limited by technique: body position, breathing, sighting. Fixing those can be worth more than months of extra metres.
If you're already a tidy swimmer, though, the swim is the most expensive minute there is. You can train hard for a season and find thirty seconds. Swim often, keep it efficient, and spend the big hours elsewhere.
Open water is its own skill. If most of your swims are in a pool, an open water session or two before the race is cheap time.
A few lessons or a squad with a coach on deck is often the cheapest swim time you'll ever buy. Video of your own stroke is humbling and useful in equal measure.
The bike: where most of the minutes are
The bike gives back the most for steady, consistent volume. Long rides at a controlled effort, some work around race pace, and rides on roads like the course. Position and pacing are worth minutes on their own, before any fitness changes.
It's also low-impact, so you can do more of it without your legs paying the price the way they do on the run.
Pacing is the free one. Riding the first hour a little easier than feels right usually costs very little on the bike and gives back a lot on the run.
The run: decided on the bike
Your run in a triathlon is rarely your open run time. It's what's left after the bike. A run that falls apart in the second half is very often a bike that was paced too hard, not a run that needs more mileage.
Running fitness still matters, and it takes longer to build safely than bike fitness. Bricks, a ride followed straight away by a short run, teach your legs the change and cost little extra time.
If you're newer to running, the cheapest run minutes come from simply running more often, at an easy pace, for months without getting hurt. Fast running can wait until the base is there.
Where your own headroom is
The rules above are general. The real answer depends on you, and on how far each of your legs sits below your own best.
LankFit works it out from your sessions. Set a goal time and Readiness shares the time you still need to find between swim, bike and run by headroom: how long each leg is, and how far your current form there sits below your best. The finish-time breakdown also shows what one fresh effort at your best pace would be worth in each leg. It's a guide to where to spend the next few weeks, not a promise of what the clock will say.