Pigs wallow in the mud because it feels good to them. Rolling around in the mud protects them from overheating. Pigs have no sweat glands in their thick skin to serve as cooling system.
Wallowing in animals is a comfort behavior during which an animal rolls its body about in mud, water or snow. Wallowingis often combined with other behaviors to fulfill its purpose; for example, elephants will often blow dirt over themselves after wallowing to create a thicker “coating”, or pigs will allow the mud to dry before rubbing themselves on a tree or rock to remove ectoparasites stuck in the mud.
Wallowing in mud helps pigs to keep cool on a hot day. Mud, tends to keep pigs cooler longer because the water in mud evaporates more slowly than pure water.
Wallowing in mud adds a protective layer against the sun for pigs as they usually have light pink skin which gets sunburned very easily. To help protect their skin from sunburn, pigs use mud as a form of sunscreen. When mud dries on their skin, it forms a barrier against the sun’s harmful ultraviolet rays.
The coating of mud helps keep off biting insects. Pigs have a reputation of being dirty and stupid because they wallow in mud. But they keep themselves cleaner than most other farm animals.
Pigs have been shown to be the most intelligent of all hoofed animals. They can be taught to perform tricks and can even become pets.
Content for this question contributed by Josh Brennan, resident of Aptos, California, USA