An and-one can occur on any type of shot. If a player is fouled shooting a 2 pointer, and he or she makes it, then there is a potential for a 3 point play, if they make the and-one free throw. Similarly, if a player is fouled shooting a 3 pointer, and he or she makes it, then there is a potential for a 4 point play, if they make the and-one free throw.
Blocking fouls and shooting fouls are the most commonly and-one fouls called by a referee. If a defender commits a shooting foul and the offensive player makes a basket, the offensive player will get a single free throw. The same goes for a blocking foul.
They create an incentive to drive the lane hard and try to draw a foul if a defender is out of position. Certain players and very good at creating contact and drawing and-ones, like James Harden. He scored an astounding 36.1 points per game, and shot an average of 11 free throws per game. Whether this was from and-ones or just normal fouls, Harden is a master at drawing fouls on the defender. Of course he has a ton more to his game than just drawing fouls, but it's just one thing that makes him a great player.