OK, what are they and what do they do?
Well, they are two glands found on either side of the dog's anal opening.
They are part of the dog's excretion process and emit an 'interesting' odour - almost certainly something to do with territory marking if you observe dogs over a period of time. This is the reason dogs smell other dogs' bottoms when they meet and greet, standing tense with tails erect to swap their own unique smells.
Could be a bit like our fingerprint, it identifies us - and so does the 'sweet perfume' of a dog's anal glands!
What happens when they go wrong?
If your dog doesn't have a problem, there is no need for you to empty his sacs.
If your dog is scooting on its bum across the carpet or when outside, or even excessively licking paws and backside then it might mean the glands are infected or full and unable to be expressed. It's uncomfortable and scooting is one way that the dog has to try and self-help ease the situation.
You need a veterinary surgeon to empty the glands, or be shown how to do it yourself by a qualified person.
How do we keep them healthy?
The smelly stuff is expressed by the glands when the dog poos, so there's a simple way to keep things healthy, and that's to feed a good diet which is easily digested and therefore does not generate excess waste products that might affect both the anal glands and also skin condition!
Poo that is too loose to pick up easily when you're out walking is not helping. Poo that's so small as to be like pooing peas is probably not much better. What you need is a food with enough good dietary fibre to hold things together and gently express the glands as your dog goes to the toilet.
Makes sense really, doesn't it?