Puzzled by the meaning of "how it was that" and the different meaning of "should have done" [duplicate]

Solution 1:

There are several things to pick apart here. First, about "should have": Yes, there is another meaning for should. (And the have is just along for the ride as part of the verb tense.) Looking at this Lexico entry for should, you're thinking mainly of definition 1, "to indicate obligation, duty, or correctness." But note definitions 3 and especially 4:

  1. formal (expressing the conditional mood) referring to a possible event or situation.
    ‘if you should change your mind, I'll be at the hotel’
  2. Used in a clause with “that” after a main clause describing feelings.
    ‘it is astonishing that we should find violence here’

That's what we're dealing with here. You could replace "should" with "could" or "might" without altering the meaning greatly.

To the phrase "how it was that," which you mention in the title, it's true that it's a bit redundant. First of all, if we straighten out the contorted syntax of the original, we get:

I cannot tell how it was that he should have guessed what she meant at that very moment.

Yes, you can arrive very nearly at the exact same meaning simply by leaving out it was that:

I cannot tell how he should have guessed what she meant at that very moment.

A hair-splitter might point out that there is a fine shade of distinction in meaning here. This altered sentence says that we can't tell how he should have guessed—by what mechanism he should have gone about guessing. The original says that we can't tell how it should come to pass that he could guess. "How it was" means that we're having trouble explaining a reality, rather than "how" that reality is executed.