It's believed to have come from the Old French word "joque," which itself likely derived from the Old Norse word "hǫkk," meaning "to mock" or "to scoff."
It's important to note that the concept of humor and jokes existed long before the word itself. People have been telling jokes for centuries, but the word to describe them evolved over time.