There are many factors: did the drugs cross state lines, is it a large quantity where the penalties are stronger in federal court was the arrest the result of DEA or a Drug Task Force operation, did the money come from out of state sources, are the co-defendants in other states, is the informant working for the feds, etc. Usually the decision involved the size of the oiperation and whether federal wiretaps or other federal law enforcement assistance was involved.
In federal court, the question is one of numbers. If the quantity of narcotics is high enough, or the dollars great enough, the feds want it. Also consider Project Safe Neighborhood, legislation that attacks drugs and guns together as a important factor.