This evocative vocalization is indicative of the American cowboy. It is often used to represent joy and the foolhardy gung-ho ambition of the Wild West.
But where did this phrase come from?
Ye is actually a misspelling, from when English still used the letter ‘thorn’, which is pronounced ‘th’. However continental printing presses did not have that character, so some printers just used a ‘y’ instead. This is why you often see ‘ye olde tavern’ or whatnot. It’s actually just a ‘the’ using the surrogate ‘y’.
Ha is an abbreviation for ‘hectare’, a measurement of land.
Thus ye-ha is properly pronounced ‘the-hectare’, though shortened for easy pronunciation. It was used by cowboys to vocally ward off competing cowboys, much like song birds sing to let their presence be known in their territory.