I actually believe they do a random drawing, meaning they put the two or three teams names into a hat and draw to see who gets the higher pick.
No. If it's a three way tie they count up the total number of illegitimate children sired by athletes currently on the roster and then divide by the number of players. The team with the highest average picks first because in the NBA lottery, losing is winning.