“I just happened to look up at the moment he walked by.” 「たまたま彼が通り過ぎる瞬間に見上げた。」

“Oh, so you just happened to be in the kitchen at the time the cookies went missing?” 「では、クッキーが消えた時点に台所にあなたがいたのが偶然だというの?」

完全に偶然だと示すために動詞の前にjust happened toをつけます。その瞬間に見上げた理由はまったくありません。偶然にそうなっただけです。

We use “just happened to” before a verb to show that something was a complete coincidence. There was no reason that I looked up at that moment. It just happened that way by chance.