attain vs come upon

attain

verb
  • To come or arrive, by motion, growth, bodily exertion, or efforts toward a place, object, state, etc. 

  • To reach or come to, by progression or motion; to arrive at (a place, time, state, etc.). 

  • To gain (an object or desired result). 

come upon

verb
  • To befall; to affect; to happen to. 

  • To discover or find, especially by chance or accident. 

How often have the words attain and come upon occurred in a corpus of books? (source: Google Ngram Viewer )