The lob in tennis is a very common type of shot used by players. In a lob shot, the player aims to have the ball go over the opponent, high enough so that they can't reach it, and have the ball touch the court deep, close to the baseline. The lob is most used when the opponent is closer to the net and trying to volley. In that situation, a lob comes in handy as if done correctly the player at the net will have a hard time running back to get to the ball.
If a lob is done incorrectly, that gives the player at the net the chance to smash the ball, which will likely lead to an easy point. Also, a player executing a lob must be careful to not have the ball go too deep on the court, to the point where the ball will touch the court out of bounds. A lob is a very useful and important shot in tennis, and so it is important that tennis players know how and when to execute a lob.
Most of the times the lob will be used as a defensive shot, that is, as a way to react to the opponent's more aggressive play. That usually happens when a player goes to the net and volleys the ball away from his opponent, who will sprint to get to the ball and hit it from below, attempting a lob shot. A defensive lob, although some type of last resource to reach a ball far away, can also end in a point, if done correctly.
Different from a defensive lob, in an offensive lob a player has the time to prepare and position to better execute the lob. An offensive lob is a good idea when the opponent's net volley is not done well, giving the player time to think and prepare for a lob, while having the deeper part of the court free. A good offensive lob has speed and some spin.