I get the feeling that kids this age will make connections and just comment on them no matter what the situation. I think that we all do this (something will jog our memories on something out of nowhere), but as we get older, we just don't really notice and don't comment, but, as you know, kids have NO filter on what they say LOL. My 2.5 YO makes comments like that which to us seem out of the blue, but to her have some tangential connection to something she is seeing or hearing. She's especially known to start singing sporadically (even at my grandfather's funeral - which was a beautiful moment BTW...) and sometimes she'll wake up with a random thought. She'll open her eyes and the first thing out of her mouth will be something like, "You flushed the stinkbug but it came back."
So glad your little guy is doing such an awesome job!