From what I can gather, the word originates in 16th century England, rooted as a contraction of the phrase used tfor inquiring on someone's health, "Huet dest þou" meaning "how d'ye do?" or "how do ye?", eventually shortened to "howdy". I don't know if "ye" in this context is pronounced [YEE] or [THEE], I am not certain but I wanna say the latter.
It eventually found its way over to the continental North America, either having already evolved or evolving into just the single word "howdy".
English is complex but interesting regardless.