Gloves act as a barrier between food and contaminants, helping to prevent the transmission of harmful pathogens during food handling.