When a player is fouled while shooting, they have the right to shoot free throws worth 1 point each. If the player was fouled during the act of shooting a three pointer, they will have three free throws, while if they were fouled while shooting a two point shot, they will have two free throw attempts. If the fouled player still manages to somehow make the shot despite the physical contact by the opponent, they will shoot only one free throw, while adding the field goal's points to the scoreboard.
That way, the team that trails hopes that the free throw shooter misses the free throws. That allows them to get the ball back without burning the clock. However, most of the time players make the free throws; still the strategy is valid, as they will seek to add three points to score while only allowing two points maximum, that way making the point difference smaller.
Don Nelson, the head coach of the Dallas Mavericks from 1997-2005, first applied hack-a-shaq against top player Shaquille O'Neal, who although was a remarkable basketball player, was also a remarkably bad free throw shooter. With hack-a-shaq, players purposely fouls a particularly bad free throw shooter. That stops the opponent's offense while exploiting an opposing player's weakness. Hack-a-Shaq is sometimes used at the middle of the game, which leads to a lot of stopping, making the game boring. Because of that, the hack-a-shaq strategy is not very liked by basketball watchers.
For the 2016-17 NBA season, the NBA introduced a rule that gives any team that is fouled one free throw and possession of the ball if the foul is made in the last two minutes of the 4th quarter or overtime. This rule is designed to prevent strategies like hack-a-shaq.
Fouling rewards the other team with free throws. The rewards improve as teams foul more. Teams enter penalty situations, like the bonus and double bonus, which gives them additional free throws every time a player is fouled. The double bonus is only in college basketball.
If you want to learn more about penalty situations, check out Basketball Penalty Situations.
In the NBA, a player will foul out of the game if they reach six fouls. In college and FIBA basketball, a player will foul out of the game if they reach five fouls.
Player fouls keep track of the amount of fouls for each player, and team fouls are a running total of the amount of fouls a team has for the entire game.
When deciding to purposely foul, you should consider the following:
Imagine a basketball game with the following score and Team A has the ball.
There is this much time on the game clock and shot clock.
Team A can let the game clock hit zero with just dribbling. Team B needs to get the ball back to even the score. To get the ball back Team B has two choices:
Stealing the ball is harder than fouling and doesn't guarantee possession. In this case, Team B should foul. It is possible that Team A makes a free throw, but it remains a one possession game. Team B gets the ball and can tie the game if they make a three-pointer.
If you want to learn more about the types of fouls in basketball check out these tutorials: