A dead ball in basketball occurs when there is a foul play or a foul play has been attempted or yet to be attempted when the referee blows the whistle.
When the play is stopped, or when the ball goes out of bounds or when the clock runs out, and the buzzer goes off.
When a dead ball occurs, a player that is injured or sometimes substituted. Dead ball occurs in a lot of games. However, a dead ball does not occur for long, and the player is put back into the play again. The NBA rule book section IV has a detailed explanation of a dead ball.
A dead ball typically occurs in basketball after the ref calls a foul or when a foul has been shot, another one is going to be made, and/or the ball has gone out of bounds. The term of a “dead ball” refers to the ball not being playable. The NBA has defined that this is a good time for player substitutions to be made, especially if a player is injured during play.
However, the answers given here aren’t quite right. A dead ball is typically called by the ref, yes, but if it rebounds and doesn’t go out of play, that’s not a dead ball. Instead, the ref is left to call it if he sees something that would make it a foul instead of just a rebound.