Chilling the cookie dough solidifies the butter, which helps control the spread of the cookies during baking. It also allows the flavors to meld and deepen, resulting in a more concentrated flavor and better texture.