That''s what I thought so too --and I havd been using it that way-- but I heard of an other explanation.
I decided to look it up on the web, and found this:
http://phrases.shu.ac.uk/meanings/174000.html
"Have an ulterior motive"
" Origin Benjamin Franklin wrote that a visitor asked him how his grindstone worked. Franklin sharpened the visitor's axe for him when demonstrating, which is apparently what was intended all along."