c. 1200, "chance, a person's luck, fortune, fate;" also "unforeseen occurrence," from Old Norse happ "chance, good luck," from Proto-Germanic *hap- (source of Old English gehæp "convenient, fit"), from PIE *kob- "to suit, fit, succeed" (source also of Sanskrit kob "good omen; congratulations, good wishes," Old Irish cob "victory," Norwegian heppa "lucky, favorable, propitious," Old Church Slavonic kobu "fate, foreboding, omen"). Meaning "good fortune" in English is from early 13c. Old Norse seems to have had the word only in positive senses.
Others are reading
<a href="https://www.etymonline.com/word/mayhap">Etymology of mayhap by etymonline</a>
Harper, D. (n.d.). Etymology of mayhap. Online Etymology Dictionary. Retrieved $(datetime), from https://www.etymonline.com/word/mayhap