With so much movement, it's not unusual for a basketball to soar out of bounds. When that happens, or after a made basket, the offensive team has to throw the ball back in to resume game play. The game has several rules to make that play fair for both sides.
Inbounding the Ball
An offensive player can inbound the ball to a teammate as he steps over the out-of-bounds line. The in-bounder can jump, move his feet, and even back up as long as he stays in a 3-foot wide spot on either side of him. It's a turnover if he moves out of that space. The in-bounder is free to run along the baseline if the other team just scored. That's most likely to happen when the defensive team is pressing at the end of a close game.
Once the referee hands the in-bounder the basketball, that player has five seconds to throw the ball into play. If the ball is being put back in play due to a violation, the game clock won't start until the ball is touched by a player on the floor. The five-second count is still on, and it's a turnover if the player doesn't beat the count.
The defensive player can't reach across the out-of-bounds line to touch the ball or interfere with the in-bounding player. The player gets a warning the first time, and a technical foul the second time.