acting titles

I recently saw RENT yet again, and I’m curious as to the definitions and differences between the following:

ensamble
swing
performing swing
understudy

How do directors/producers decide between the “star” and the understudy? The last time I saw RENT, an understudy played Roger, and he was great. Does that mean that the actor who really played Roger is that much better?

(Perhaps I should also note that I live in Baltimore, so I’m talking about national touring companies . . . if that makes a difference.)

The producers make the better (or big name) actor the star. An understudy is only there to go on as a replacement if the star is sick. Usually on road shows, they are another member of the cast and they have fewer people in the chorus (or figure out a way to double up roles).