The answer is protect the body from infection by pathogens
The physical barrier is made of epithelial cells, mostly will be keratinized to increase their sturdiness further. They will impede the pathogen physically by barricading the cells, makes the pathogen could not invade deeper part of the body. Histamine and antibodies should be the role of immune cells, not epithelial.