Mending a line in fly fishing is a crucial technique used to manage the fly line after casting and landing on the water. Notice that I said after casting and landing on the water. The reason is that if you are casting and mending in the air it is called an aerial mend. Instead of diving into that subject and providing an advanced casting lesson on aerial mends let's focus on true mends that are on the water.
The purpose of mending is to improve your drift. There are several ways to improve drift. One is to eliminate or reduce drag, which occurs when the line and the fly move at different speeds due to varying currents. Another is to do the same but adjust your indicator position to lessen drag. The third is to adjust the line on or in the water to set up for a dragless presentation.