The issue is that the two selector have the same specificity. The only thing that CSS knows to do with selectors of the same specificity is to choose the most recent one
Thus, you need to make the specificity of the child more than the firsts, one way is to put
.primary .secondary a {
color:green;
}
Another way would be to put the element type in addition to the class
This is the reason why it is proper formatting to structure your CSS as the page it is laid out in the HTML, with parents coming before children
For more information as to how specificity is determined, check here