AUX n -edThe auxiliary verb had is followed by a noun group and the '-ed' form of another verb. The noun group is the Subject. This pattern is always used with another clause, which comes before or after this one.
This pattern is used to indicate a situation that might have happened but did not. Its meaning is similar to the meaning of a clause beginning with if, but this pattern is more formal.
The captain of the boat did not want to leave; he wanted to remain on his vessel and try and do something. Had he remained, he would have gone down with his boat.
Kay didn't know of the affair he was having with a younger woman, but she probably would not have done anything about it had she known.