How is the order of the NFL draft determined?

The order of the NFL draft is determined by the record of each team during the previous season. The teams with the worst records choose before the teams with better records.