Boar taint is caused by the accumulation of two compounds - androstenone and skatole - in the fat of a minor number of male pigs.
Androstenone (a male pheromone) is produced in the testes as male pigs reach puberty, while skatole (a byproduct of intestinal bacteria, or bacterial metabolite of the amino acid tryptophan) is produced in both male and female pigs.