It's based on ilvl. 1-29 Grade I, 30-44 Grade II, 45-54 Grade III, 55+ Grade III with a small chance for Grade IV.