I'll build on @HenningMakholm's excellent answer. Mid-air refueling brings lots of cost-benefits beyond the obvious "make planes go farther". First, tankers can provide operational flexibility and efficiency compared to having to set up closer airbases.
- You don't have to set up a closer airbase.
- You don't have to build it.
- You don't have to conquer and secure that space (very costly).
- Your airbases can be farther away from the front lines.
- Immune from artillery and ground attack.
- More layers of air defenses.
- More warning of air attack.
- You don't have to keep moving and rebuilding your airbases as the front line moves.
- And all their fuel, ordinance, personnel, hangars, buildings, bunkers, defenses...
- You can respond faster to changes on the ground providing better support.
- You can strike much, much deeper into enemy territory.
- You can attack from unexpected directions.
- Put a tanker where you have no airbases, attack from that direction.
But does it save fuel?
Central point number one: combat aircraft are inefficient, tankers are efficient and somebody has to drag that fuel out there. Might as well be a tanker.
While keeping a tanker in the air might seem like a waste of fuel, and it does have to burn fuel while in the air, it likely saves a lot of fuel because tankers are so efficient and combat aircraft are so inefficient. A tanker is typically based on a civilian airliner. Once it's at altitude and in position, it can run racetrack laps at its most efficient speed and altitude (many combat aircraft have trouble going slow enough for the tanker) sipping fuel compared to the ordinance laden (ie. lots of drag), high performance aircraft it's fueling.
If that very efficient tanker didn't drag that fuel out there, those same laden, inefficient combat aircraft would have to and this leads to what is known as The Tyranny Of The Rocket Equation which says to carry more fuel you need even more fuel. If you have a lot of inefficient aircraft, it can save fuel to have them take off with half empty tanks and top up at an efficient tanker on the way. The Rocket Equation is so tyrannical you can save fuel even in civilian flights, here's a paper on the subject (sorry about the paywall).
Central point number two: make as few combat trips as possible to destroy a target. A plane can only carry so much, and more fuel means less weapons. Less weapons means more trips. More trips means more fuel. More importantly it means more times the pilot and airframe are exposed to danger (and if you need to take two trips you've probably lost the element of surprise), and more aircraft needed to attack the same number of targets.
Take off is another consideration. Taking off and climbing to altitude is one of the most fuel hungry parts of a flight. Combat and long haul aircraft typically take off near maximum weight requiring full engine power and a long climb. Taking off with less fuel means you burn less fuel getting to altitude.
Heavier aircraft need a longer runway to take off from. That runway length may not be available at your forward base, or it may be damaged. Less fuel means heavier weapon loads with shorter runways which means more flexibility.
Combat aircraft can only carry so much fuel internally before they need drop tanks. Drop tanks add drag making the aircraft less fuel efficient and generally maneuver like a pig. Drop tanks also take up precious hard point space for weapons which means more round trips which means... you get the idea.
You can take this idea too far. The biggest problem with the F/A-18 Hornet was its measly fuel load. The long ranges typically required at sea meant it practically required a tanker to operate effectively. Carriers can't carry big tankers, so they had to resort to inefficient buddy packs mounted on smaller aircraft. This problem was resolved with the F/A-18 Super Hornet which is practically a different aircraft.