okay, more fleshed-out example:
3 player game. you are player 1 and have, say, 24 points. player 2 has 25 points. player 3 has 29 points. there are 2 provinces left, and a three-pile is not a threat. It's your turn.
You have a starting hand of spy-necropolis-laboratory-cutpurse-duchess. You play necropolis, then cutpurse (you do this first because you know neither player has any copper and you want to see their hands). player 2 has a counterfeit, a gold, and 3 useless cards in their hand. They also have a caravan in play. player 3 has KC-KC-bridge-bridge-bridge. Then you play lab and draw two KC.
Now your hand is KC-KC-spy-duchess, you have 1 action left, 2$, 1 buy. You play KC-KC-spy to start. You draw 3 useless cards, discard 2 useless cards, and the last one doesn't matter. What player 3 reveals doesn't matter. You have been tracking player 2's deck (by playing cutpurse) and their last cards are 20 golds, 1 abandoned mine, and 3 useless cards. You luckily hit the abandoned mine right away, and leave it there.
And now here's the best part. You pass on your second KC action, then KC the duchess. This tells player 2 that you aren't going to be getting any additional buys because you are now out of actions (you don't have a counterfeit in your deck). You have exactly 8$ and are going to be buying the penultimate province, which he knows you know is the right move because you saw player 2's hand. He knows that buying the province is the only way for you to get second place, because otherwise Player 3 will get a turn and P1 will lose. So while he will almost certainly be able to get a gold by discarding to the duchess, he won't need to be able to get an estate with his province, and there is a slim chance he can't get a gold. The only way to guarantee the win is to keep the abandoned mine. If you had played the duchess second, he would have thought you were probably playing another action, possibly getting another buy and maybe more money, so I might have been able to add on an estate. In this case, P2 would have gone for the gold that he almost certainly would get so that he can get an estate as well as a province on his turn.
So P2 leaves the abandoned mine, and you buy the penultimate province. P2 then draw and plays the abandoned mine, counterfeits the gold, and buys the last province. ending the game. final scores: P1: 30, P2: 31, P3: 29.
The only way for P1 to get second place instead of last was for him to do nothing for the second KC action.
now, how the game got to this state, and if there are too many kingdom cards, I have no idea.
Someone's gonna reply with a simple 1 card solution now.
Pre-Post-Edit: darn, looks like an answer got posted while I was working on this.