Hello.i didn't realize grammar of paragraph 2.had they known.....could you explain for me please?

hello.i didn’t realize grammar of paragraph 2.had they known…could you explain for me please?

Had I known (that) + unknown fact + (then) different action

  • Had I known that housing prices would drop, I wouldn’t have bought a home last year.
  • Had I known it would be so busy, I would have come earlier.
  • Had I known that it was her birthday, I would have bought her a present.
  • Had I known that it would be on sale this week, I would have waited to buy it.
  • Had I known you were a vegetarian, I wouldn’t have made chicken for dinner.
  • Had I known that he wasn’t coming, I wouldn’t have made so much food.
  • Had I known our class was canceled today, I would have stayed in bed.
    We can also switch the order of the sentence.

Different action + had I known (that) + unknown fact

  • I would have invited you to the concert had I known you were a fan of the band.
  • I could’ve helped him had I known that he needed help.
  • We would never have bought this house had we known that we would have 5 children.