The baking soda helps create a light and airy texture in the cookies due to its leavening properties. It also helps neutralize the acidic ingredients, such as the chocolate chips, giving them a more mellow flavor.