Don’t Enlist in ANY Army!

How come religious Jews have joined non-Jewish armies so freely these past few centuries?

I haven’t learned the matter in depth myself yet (and could not locate responsa either), so this isn’t near final, but there is this Tosafos, Avoda Zara 18b:

שלא יתחשב עמהם, פרש”י לחזקם לצור על העיר והר”ר אלחנן פירש להיות ממספר אנשי הצבא של עובדי כוכבים

(By the way, our own version of Rashi has a Vav: שלא יתחשב עמהם, לחזק עובדי כוכבים ולעשות עמהם מצור.)

Not to mention many other issues.