To take off on Ruds' answer, if you have AQ9 in the dummy, you play the queen if West covers with the J or T, and the nine otherwise. This gains under the following circumstances.
- The king is "onside" (with West), so playing the Q wins the finesse.
2a. The king is "offside (with East), but both J and T are onside with West. Playing the Q on say, the T uses up two opposing cards (T and K) for the price of one. You end with A9 in dummy against Jx (or more x's) in West.
2b. The king is "offside (with East), both J and T are onside with West, but West "ducks" with a low card. Then playing the 9 forces out the K from East, promoting your Q.
If you have AQ8 and West has JT9, he should play one of those. Then 2b no longer works because West will have JT against your A8. On the other hand, if E has K9 (or better), your 8 will lose to the 9, not drive out the K, so 2a no longer applies. Of course, 1 still applies.
Since you can't gain from playing 8 from AQ8, you play the Q straightaway and hope for the best.