Adam Smith identified five factors, which seem durable:
The five following are the principal circumstances which, so far as I have been able to observe, make up for a small pecuniary gain in some employments, and counterbalance a great one in others. First, the agreeableness or disagreeableness of the employments themselves; secondly, the easiness and cheapness, or the difficulty and expense of learning them; thirdly, the constancy or inconstancy of employment in them; fourthly, the small or great trust which must be reposed in those who exercise them; and, fifthly, the probability or improbability of success in them.
My favorite subject to teach is electrical. No one is ambivalent; they're either completely on board or want no part of it. And students pay rapt attention. Well, at least if they don't, it's only once.