South played low from dummy on the opening seven of spades lead, overtaken by East with the eight. South asked and found out that his opponents lead the middle card from three low cards. East would not have played the eight without the queen, jack, and 10. Declarer decided East likely had a six-card spade suit and a hold-up play would be pointless, so he won the opening lead with his ace.
The queen of hearts was ducked, but East won the heart continuation with the ace and led the queen of spades to declarer’s king. South crossed to dummy with the ace of clubs and cashed the two high hearts. He discarded two diamonds as East parted with a low diamond. South was hoping that West started with three clubs. A club could then be conceded to West and declarer would have his ninth trick in clubs.
That was not possible when East showed out on a club to the king. East, however, discarded a spade, so it was now safe to throw East in with a spade and force him to lead from his king of diamonds in the end. Note that this line of play would not have been possible if South had “held up” in spades. It was important for South to win the first two rounds of spades, retaining the small spade in his hand.
It would not have helped East to discard another diamond, as then a diamond to the ace would have assured the contract no matter who held the king.