These two expressions are very similar, they both basically mean if something happens. The main difference in use is grammatical.
The meaning of these two sentences is the same.
She took an umbrella, just in case it rains.
She took an umbrella in case of rain.
In both cases, she took an umbrella because it may rain later.
In case means because something might happen/occur. It is often used before before a pronoun (In case you feel cold, take my coat) or at the end of a sentence (We don't want to be late so let's wake up early just in case)
In case of means if there should happen to be / because of the possibility of. It is followed by a noun (In case of fire, ring the alarm bell).
Now decide which form is needed in these sentences: