The phrase "If you give a mouse a cookie" originates from a popular children's book by Laura Joffe Numeroff, first published in 1985. The story illustrates a circular chain of events triggered by a simple act of kindness: when a boy gives a cookie to a mouse, the mouse then asks for a glass of milk, which leads to more requests like a straw, a napkin, a mirror to check for a milk mustache, nail scissors for a trim, a broom to sweep, and so on, eventually circling back to wanting another cookie. This saying has come to metaphorically mean that a small action or favor can lead to a series of escalating demands and consequences. It's often used as a cautionary tale about how generosity or small concessions can unintentionally lead to more and more requests or obligations, highlighting the need to consider the potential outcomes of seemingly harmless actions.
The book itself is beloved for its simple, rhythmic text and is often used to teach cause and effect to children, showing how one action can lead to a chain reaction.
So, "when you give a mouse a cookie" refers to the start of a sequence of escalating events resulting from an initial act of kindness or giving.