When the snake touches the food, it "eats" it — this triggers code to:
Increase the score or snake length
Remove (or hide) the old food
Generate new food at a random position
Old food disappears because the game is programmed to remove it after it's eaten, so only one food item is on screen at a time.