The foul types and rules of fouls differ at all levels of play in high school basketball, the NBA, college basketball, and FIBA.
Here is a list of fouls in basketball:
A personal foul is any rule breaking physical action by a player. Any illegal contact like pushing, grabbing, hitting, and tripping are personal fouls. Personal fouls can be committed by both players on offense or defense, although there are more defensive fouls in a game than offensive fouls. Fouls are part of the game of basketball, and committing and suffering fouls is all part of the game.
Defensive fouls are committed whenever players on defense use of illegal contact to try to stop attacking players. Defensive fouls happen all the time in basketball. Defenders are allowed to move sideways and backward to block an attacker's path, moving forward (pushing the attacker backward) is not allowed. Players also can't initiate contact on defense, as that is a foul that happens mostly when a player unsuccessfully tries to steal the ball or block a shot. Defensive fouls have different penalties depending on what point of a play they were committed.
Whenever a defender commits a foul on the opponent while he is shooting, the player who suffered the foul gets to shoot free throws. These fouls are called shooting fouls. If the shooter was attempting a three-point shot, he gets three free throws, while if it is a two-point attempt, only two shots.
Offensive fouls in basketball are the illegal contacts committed by offensive players. Offensively, players sometimes foul when trying to get past defense by pushing or holding opponents. The most common offensive fouls are charging fouls, and illegal screens. Every offensive foul leads to change of possession, unless the team who committed a foul is in a penalty situation.
Flagrant fouls occur when a player makes unnecessary and violent contact with an opposing player. Flagrant fouls do not need to be intentional, but often appear to be. There are two kinds of flagrant fouls: Flagrant 1 or Flagrant 2. A player who commits a Flagrant 2 will be ejected from the game. The result of a flagrant foul is two free throws and possession of the ball.
Technical fouls are those that do not involve any illegal physical contact, but do break a rule in basketball's rulebook. That includes calling for a timeout when the team has none left, screaming at a player or referee, and fighting. The penalty for a technical is a free throw plus possession of the ball for the opposing team.
There is not a maximum amount of fouls a team can commit. However, once a team has reached a certain number of fouls (depending on the playing level), the opposing team will be rewarded with free throws after any defensive foul is committed.