How does one make 12 tricks on this hand? Two declarers did.
It is the same in both spades and no-trumps.
The lead is immaterial, so assume the lead of the HJ in 6S. Declarer wins, and plays to the SK. When the S10 drops, Declarer continues with the S8 and continues with 2 more rounds of trumps.
Declarer can count 10 tricks (5 spades, 3 hearts and 2 diamonds). The 11th can come from diamonds or clubs. Playing in a 6-level contract, one would have to play for the CA being with West, and lead the C8 from Dummy. This is still a reasonable approach trying to make 11 tricks, because if the CA is with East, you still have the opportunity to lead towards the CJ9.
If West rises with the CA, he has to continue with a club won by Declarer's CK. Since East's CQ drops, Dummy's CJ will be the 12th trick (5 spades, 3 hearts, 2 diamonds and 2 clubs). (Note that if West has one more club and one fewer heart, the CQ will not fall. However, the play of the 5th spade by Declarer will squeeze East in clubs and diamonds, and 12 tricks will be made.)
Of course, if West manages to duck the CA, Declarer will be held to 11 tricks.