The NBA manually records where the shots are taken, and if it is made or not by the stat person.
I was looking at espn's feed of the game the other night and they seem to have a lot of details about the game as the game is being played. things like "player missed 13 foot jump shot" and a graphic of a ball bouncing off of the rim and where it was shot from. Id imagine that they have a system like court stenographers so that they can quickly record info and send it to their servers.