In order to be drafted into the NBA you must be at least 19 years of age, and if they are an american citizen, they must be graduated for one year. The star players from high school, sign with big named colleges such as Duke, Kentucky, or Villanova.
They usually play just one year and then declare for the NBA draft. They do this because they can't declare for the draft right out of highschool. They are called "one and dones" because they play one year and then stop.
The draft itself is simple. The NBA teams look over all of the college players, and international players. They see which ones look the best overall for there team. The worst teams get the first picks. The better teams have to wait till the end of that round, so they don't have as good a chance of getting star players.