Toddler bit baby

My very intelligent 2 year old daughter bit my 4 month old son so hard on his cheek I was able to see every tooth impression. I literally turned my back for 2 seconds and my son screamed at the top of his lungs almost broke my heart. In the heat of the moment I gave my daughter 2 little pops on the buttocks as an instant reaction. She knows biting is wrong I don't know why would she do that. What do you do in a situation like that? I didn't really want to pop her it just happened I hugged her after but I didn't feel bad for popping her. My baby still have a mark on his face he fell asleep a little after it was just so bad🥺. How can I better reinforce her if issues like this arise again? She's typically loving to him always hugging and kissing him. I don't know if his fat little cheeks cause he is a 20 pound chunky little thing just made her curious.