Anal glands, also known as anal sacs, are small pouches located on either side of your dog's anus. These sacs contain specialized sweat glands that produce a unique-smelling secretion, which serves as a scent marker for dogs. When your dog defecates, these secretions are released onto their feces, conveying vital chemical information to other dogs. This explains the inquisitive behavior your dog displays toward other dogs' poop.
Dogs also "express" their anal sacs when scared, emitting a rather odorous scent. This characteristic aroma is often described as fishy. If your dog consistently smells like fish, it's a strong indicator of potential anal gland issues.