The NBA Draft is an annual event where (now 30 teams) the league franchises draft players, who are eligible and wish to play in the league, to their teams. The players are usually college basketball players but international players can also be picked if eligible.
The eligibility criteria is as follows: All college players that have completed their four years at college are automatically eligible, however, the underclassman have to declare their eligibility by foregoing their remaining college career. For international players, the automatic eligibility comes if they are aged 22. If younger, they must declare their eligibility.
The Draft is usually held in the second half of June, just over a couple of days after the NBA Finals end. Since 1989, the Draft has consisted of two rounds and allows a total of 60 players to be drafted (30 in each round). Up until 2006, even high school players could be drafted into the league but that isn't possible anymore. Now, every player that wishes to be drafted into the league without playing in college is eligible one year after graduating from high school or they must at least be 19 years old as of the end of the calendar year of the Draft.
The order for the Draft, especially for the top 15 picks of each round, is determined at the Draft Lottery. Normally held in the second or third week of May, this event is for the non-Playoff teams as they come together to participate in a slate-lottery style process in order to determine the first three picks of the Draft. In the current lottery system, the league uses "a lottery-style ping-pong ball machine with 14 balls numbered 1-14, and 1,000 four-digit combinations are assigned to the 14 lottery teams." The worst team receives 250 combinations, the second-worst gets 199 and so forth.
After the order and teams for the first three picks are determined, the rest of the teams are ordered in the reverse order based on their record in the previous regular season.