What is the origin of the word ‘ye’?
The use of ye for the, like the use of f for s, results from a misreading of old letter-forms, in this case the letter ‘thorn’ (for the sound ‘th’), which in its plain version looks like a p with the stem extended above the loop. ‘Thorn’ originated as a runic letter, and is still used in writing the Icelandic language.
This is quite different from the word ye as it appears, for example, in Christmas carols such as ‘O Come All Ye Faithful’, which (as you would expect) is just an old form of the word you. It was used mainly to refer to more than one person as the subject of the sentence (with you as the object). One person was referred to as thou (subject) or thee (object, though some dialects use thee for both).
Some ‘olde’ spellings are actually inventions, as jokes about ‘Ye Olde Chippe Shoppe’ would suggest! There is, for example, no historical reason for the spelling of the second word in the name used by the vocal group called the ‘Mediaeval Baebes’.