2-on-1 in basketball is when two players on offense are in transition and there is only one defender there to stop the fast break. This scenario is often the result of a steal or turnover that did not allow the rest of the players to catch up. It is generally expected that the offense should always score in 2 on 1 situations unless they make a mistake or the defender makes an outstanding play.
The ball handler has two options, either attempt to score or pass the ball. The main goal of this player is to bait the defender into playing defense solely on him or being quick enough to score while the defender is worried about his teammate. The closer the players gets to the basket, the easier it is for the defender to guard both of them, which is why it is important to space the floor as they attack the basket.
In theory it may seem like a good idea to continually pass the ball back and forth until the defender allows an opening, this strategy allows a larger chance of a mistake to be made. Moreover, the longer the players take to score, the more time additional defenders have to run back and help prevent a basket.
The lone defender has a tough job in preventing a basket, but there are still ways to increase their chances. One plan is to just wait underneath the basket or as low as the closest offensive players. This may force the offensive player to attempt a lower percentage jump shot rather than going for a layup. Another possibility is quickly running at the ball handler and hoping that the pressure is enough to force an errant pass or miss-dribble.