Since 1985, all teams that have missed the playoffs have participated in a lottery system to see who gets the first pick. The lottery system has changed a few times since then, but the system that the NBA uses right now uses ping pong balls that have numbers written on them. A machine picks four balls at a time, and every possible combination of numbers is assigned to a team. Teams with worse records get more combinations of numbers, which means that they have a better chance to win. The machine picks three teams, and these teams get the first three picks in the draft. The other eleven teams will pick in order of how bad their records are, so the worst team that was not selected will pick fourth, and so on.