Evolution
Evolution may occur overtime through a succession of mutations or a gene that might be used for a different purpose than originally expressed. With that in mind, mountain goats with horns may have evolved from an ancestral population without horns through the following process. A goat that had a mutation for slight nubs where horns are located and due to genetic drift or selection that goat passed on that trait. Again another mutation might occur where the nubs grow more into smaller horns and that goat may pass on that trait due to drift or selection. This repeats until goats have full horns. Again this trait may be selected for due to mating reasons, influencing natural selection and making the trait have higher fitness. The trait may have also been influenced by genetic drift and been under no selection.
Another possible theory in terms of genetics is that there could be a mutation in the promoter region specifically that codes for small horns resulting in over expression. Again the theory could be overexpression increased over time due to mutations until the fitness decreased when a goat had horns that were too large.
Recent comments