"the ox of your foe": Here we find that idolators are called "foes" to Israel in all instance, as in (Devarim 23:10) "When you go out as a troop against your foes," and (Ibid. 21:10) "When you go out to war against your foes." R. Eliezer says: Scripture here speaks of a proselyte who backslid. R. Yitzchak says: It speaks of an Israelite. Why, then, is he called your foe? If he hit your son or quarreled with you he becomes "your foe" for the moment.
Who Is the Foe the Torah Refers to in Kaspa
Mekhilta Tractate Kaspa 2:24