The bidding was simple. After West's pass, North opened the bidding with 1NT (12-14). South transferred to spades and bid 3NT over North's 2♠ response, which North corrected to 4♠.
With little to go on, East led the ♠10. Declarer played low from dummy and West won with the ♠K. West now switched to ♦K which held the trick, and followed with ♦8 which declarer won with the ace.
Declarer continued by playing a spade to dummy's ace, partner playing the ♠2 and another spade from dummy on which partner played ♠J and declarer won with the ♠Q. Unwilling to release a club or a heart at this stage, you postpone the decision by discarding your last diamond but declarer follows by leading a diamond from hand and you have to decide......
Well, partner has already showed up with 9 points, so there is no room for him to have the king in either clubs or hearts, hence declarer has nine tricks. If declarer also had the ♥Q, that would mean ten tricks so we might as well suppose that partner has that card - in which case he certainly won't have ♣J.
What about shape? If declarer had a doubleton in either clubs or hearts, he would not have played the hand this way, so we can assume that he has at least three cards in both those suits to go with his three spades and three diamonds. What is his thirteenth card?
If it is a club, you are finished anyway. Declarer knows that you have the ♣Q (you would surely not have led a risky spade to trick one with ♥QJ in your hand), so he will play his clubs from the top and even if partner has ♣108, you won't be able to stop him from establishing a third club winner.
So, you conclude that you can safely throw a club at this juncture.
Declarer ruffs the diamond in dummy, plays a heart to his king and leads his fourth diamond from hand, what now?
The easiest thing to do - and what happened at the table - is to think that the thirteenth heart no longer matters and to discard one. Fatal error - this is easy for declarer to read. He ruffs with dummy's last trump, plays ♥A and dummy's last heart. Whether partner wins with ♥Q, or unblocks and you win with ♥J, your side is endplayed. At the table, West won and had to lead a club. On the ♣5 lead, declarer played low from hand and the ♣Q was sandwiched between the ♣A9 tenace on table.
However, if instead you counter-intuitively discarded a club on the fourth round of diamonds, declarer has a tricky decision. He might of course guess right by playing his clubs from the top, dropping your now doubleton queen. But he might also decide to play you to have started with five clubs and your partner to have a doubleton ♣10. Now the right play would be to play a club to the king and then play back the ♣J to pin the presumed ten in West's hand.
Assuming that declarer would have guessed wrong, discarding a second club made the difference between a near top and a near bottom!