On the night of March 30, 2005, the Powerball jackpot was 25 million dollars. The grand prize winner was in Tennessee, but all over the United States, one hundred and ten second-place winners came forward. Normally just three or four players guess all but the last digit and claim a secondary prize, but this time something was clearly different.

Lottery officials were flustered, unsure if there was a computer glitch or a hack in the system, but when they asked the winners how they picked their numbers each had the same response: from a fortune cookie.

What we call Chinese food (including the fortune-filled cookies) has become an integral part of the American culture and cuisine, with a complex history that dates back to the 19th Century.

Around the 1850s, new Chinese immigrants were seen as a threat to jobs occupied by American males such as mining, farming, and manual labor. After a wave of anti-Chinese violence, Chinese immigrants began to work in laundries and restaurants: industries traditionally associated with women’s work.

“Chinese” restaurants began to appear, but with new dishes designed to appeal to Americans who tend to want foods that are sweet and fried. The most famous of these faux-Chinese recipes is Chop suey, which translates roughly as ‘odds and ends.’ Chop Suey is as American as apple pie, which leads us to another essential ingredient for an American culinary audience: dessert.

The fortune cookie appeared in the United States in the 1920s, but it was not imported from China. Still, many contemporary cookies and their fortunes are made by Chinese Americans.

Steven Yang, founder of Yang’s Fortunes Incorporated in San Francisco, prints the paper fortunes for cookie factories around the country—including the fortunes for Panda Express. A typical 50-pound box at his factory contains 300,000 printed slips derived from the company’s list of 5,000 unique fortunes.

The fortunes are mostly written by Yang’s daughter, Lisa, who gathers sayings from books or quotes, or simply makes phrases up.

Fortunes, it turns out, are deceptively difficult to write, as they must be upbeat, generally applicable, and, above all, inoffensive. A fortune that reads, “lighten up,” for example, could be taken as a critique of a person’s weight.

Still, neither fortunes nor cookies are Chinese in origin. The woodblock print above evidences the cookie’s ties to Japan. Such evidence is bolstered by memories of Japanese Americans like Sally Osaki, who recalls snacking on fortune cookies as a child and reading fortunes in Japanese.

Author and journalist Jennifer 8. Lee interviewed Osaki and others, and even took a trip to a Shinto shrine outside Kyoto, Japan in order to further investigate the Japanese origins of contemporary fortune cookies.

What she found was a larger, darker and less-sweet ancestor to the American fortune cookie. Yet if these snacks have such clear Japanese heritage, why do we eat fortunes with Chinese food rather than at sushi restaurants?

Like the Chinese immigrants before them, many Japanese immigrants to the United States chose to make their living in the food industry. The Japanese also opted to cater to American tastes, and Japanese families frequently owned, operated, and otherwise worked in (American-style) Chinese restaurants, and ultimately introduced Americanized fortune cookies into the mix.

During World War II, many Japanese Americans were sent to concentration camps, forced to leave businesses behind. After a four-year period, the concentration camps, closed, and the cultural source of fortunate cookies was obscured and a pervasive association had spread: fortune cookies were henceforth broadly thought of as Chinese.

The fortune cookie has become a global phenomenon, found in countries around the world. Except in China. They still don’t eat fortune cookies in China.