The name of the fruit was NARANJ in Sanskrit. This language was spoken in ancient India. Indians traded with Arabs, so the word passed into Arabic as NARANJAH. The Spaniards were ruled by north African Arabs who passed the fruit and word into Spanish as NARANJA (pronounced as NARANHA).
This came into English where the fruit was a NARANJ. Words ending in J are not common in English so the spelling quickly changed to a NARANGE.
The initial N moved to the a because of mis-hearing to give an ARANGE (this is called metanalysis).
Over time, the initial A became an O to give an ORANGE.
Where Words Come From