Why does the axion solve the CP problem?

I don't understand why the CP violating term in QCD vanishes when we introduce the axion. The term is $$\left(\frac{a}{f_a}+\theta\right)G\tilde{G}$$ It is claimed that $$\left\langle a\right\rangle=-\theta f_a$$ which cancels the term, but why is the VEV this value?