Just in case has 3 different meanings across 2 categories:
Adverb · Conj
if there happens to be need
"in case of trouble call 911"
"I have money, just in case"
In the event; should there be a need.
if and only if