What does "so it was that" mean here?
"So it is/was that" is an expression that means something similar to "as a consequence" or "as a result." It is used to indicate that as a result of X, Y occurs or happens. In this case, the third brother in the story asked for a tool to help him hide from death (X), and "so it was that" (as a consequence, as a result), Death gave him his invisibility cloak (Y). This expression is not used very commonly in conversation. It is more commonly found in stories or literature. Ex: Randy set a national record, and so it was that he became a town legend. Ex: The flood ruined all of the crops, and so it was that the town suffered terribly that year.