She was making cookies for guests, and when she ran out of baker's chocolate, she chopped up a Nestle semi-sweet chocolate bar to use instead. This resulted in the now-famous chocolate chip cookie.
While she didn't invent the cookie itself, her creation of the chocolate chip cookie is widely celebrated and is a staple in bakeries and kitchens around the world.