America existed for more than 160 years before chocolate-chip cookies did.

There were cookies, yes—the first written recipe for an American cookie was published in 1796 in the book American Cookery and called for boiled sugar (to separate the scummy impurities) and powdered coriander. The machine that made Fig Newtons was invented in 1891. Fannie Farmer's 1896 Boston Cooking-School Cook Book included a recipe for oatmeal-raisin cookies. By the first decade of the 20th century, brownies (which are, technically, a type of bar cookie) were being baked.

But no one had taken cookie dough and folded in chunks of chocolate. Any time chocolate went into cookies, it was melted first.

It was Ruth Wakefield who changed that. The proprietor of the Toll House restaurant in Whitman, Mass., Wakefield was good at desserts. As Carolyn Wyman writes in The Great American Chocolate Chip Cookie Book, the Toll House restaurant had a menu just for desserts, and those desserts had a celebrity following. (Joseph Kennedy, Sr., Wyman writes, would order Toll House brownies for his kids. Duncan Hines liked the lemon meringue pie.)

In 1938, Ruth Wakefield added pieces of a chopped up Nestle bar to cookies she planned on serving with ice cream. Food editors picked up on the idea, and the recipe started circulating through the press and gaining huge popularity. In 1939, Wakefield gave Nestle permission to print her recipe on the back of its chocolate bars. And from then on America had chocolate-chip cookies.

What's less certain is why, exactly, Wakefield put the chopped-up chocolate into her cookies to begin with. A few versions of the story have her creating the recipe accidentally—she was out of nuts, she thought the chocolate would melt into the batter, the chips fell into the bowl by accident. Wyman, in her book, argues that Wakefield was too much of a perfectionist to have come upon the recipe so haphazardly. In support of her argument, she cites a few accounts from the 1970s in which Wakefield tells reporters that she'd been planning experiments with chocolate chunks.

Any account of the cookie's creation, though, has a hint of myth-making to it: No one was documenting the cookie's creation at the time. Who could have known that it would be such an innovation?

Like many great inventions, though, the chocolate cookie has been iterated and improved upon in the years since its creation—so much so that the chocolate-chip cookie eaters of today would hardly recognize Wakefield's chocolate chip cookies as such. As Dédé Wilson writes in the Boston Globe:

[T]he treats that Wakefield first made at the inn, which she and her husband, Kenneth, owned, were so tiny, that a single cookie — the size of a quarter — was not quite a bite…. the tinier versions turn out quite crunchy… they have a crisp texture with a buttery, caramelized, butterscotch-like flavor. The chocolate is generous but not overwhelming and nuts add both texture and flavor.

If you want to taste what Wakefield did, here's the recipe. It may not be a chocolate chip cookie in its most modern and highest form, but it still sounds pretty tasty.