According to the rules, the attacking side’s shot is equal to “the end of its control over the ball”. The ball after it gets stuck on the neck of the basket, which means that no one controls the ball right on both sides, so the middle circle of both sides jump ball.
Details of basketball rules