In some words, the stress is on the first syllable of inter, for stance, intercourse, interview, internet, interval.
However, there are also some words, in which the stress is on the second syllable of inter, for instance, interpret, internal.
What's the cause of this difference?