1.the 3rd/4th year need some credit to proceed or to graduate, so they are in priority,
2.the first year need to get a good start, as they need to get a chance to pick
3.the 2nd year have had their turn when they were first yer, but did they didn't use it, well, that wasn't a problem for anyone else.
For the departments, they will put all their own major students throught first, since those students HAVE to take certain courses. But for elective, students can always pick something else, that is why it is call elective.