Genetics for Polled vs. horned
The dominant trait is for goats to be polled which is indicated here by the capital P for polled. Horns are the result of two recessive genes which are indicated here by the lower case p for horned. You would not be able to tell the difference in a polled animal that carries two dominant genes from one that carries one recessive gene for horned. This explains how it is possible to breed two polled animals and have some offspring have horns. This would indicate that both parents carry a recessive gene for horns.
PP: This animal is polled, and does not carry the gene for horns.
Pp: This animal would be polled, and carry a recessive gene for horns.
pp: This animal has horns. An animal must carry two genes for horns to have horns.
Here are the various breeding scenarios with the resulting offspring:
Horned (pp) X Horned (pp) = 100% horned (pp) offspring.
Polled (Pp) X Horned (pp) = 50% polled (Pp), 50% horned (pp) offspring.
Polled (Pp) X Polled (Pp) = 25% polled (PP), 50% polled (Pp), 25% horned (pp) offspring
Homozygous polled (PP) X Horned (pp) = All polled (Pp) offspring.
Homozygous polled (PP) X Homozygous Polled (PP) = All homozygous polled (PP) offspring.