stinky dog tricks

I like to take my dogs for a good long walk every morning. One of them occasionally finds something good and stinky (to humans anyway),gives it a good sniff, and then rolls around in it with gusto. She’s festooned herself with rotten garbage, sheep droplets, fresh dog leavings-behind, and dead bugs. Boy does she seem happy with herself when she’s covered with somthing icky. Anybody know why dogs like to roll around in stinky guk?