It may help to understand this if we back up from the idiom "in case", and first just discuss case.
A case is a hypothetical, possible, or archetypical situation. A good synonym for case is scenario. One can think of it as meaning "one possible configuration of events or circumstances, out of many".
We use the word "case" in the construction "in this/that/the/its/his/her/their case" to refer to a specific scenario and describe it:
In the case that it rains, we'll be glad we brought umbrellas.
This would only be idiomatic in cases where we were discussing the other cases and our plans for them too.
The idiom "in case", with no definite article in there, and no other specifiers, is a synonym for lest and means "to address the possibility of this case".
You should take an umbrella in case it rains.
Means
You should take an umbrella to address the possibility of the case that it rains.
The in case idiom is not used exclusively when comparing different cases. It is used simply to draw attention to the fact that a scenario (usually negative, or at least problematic*) is possible.
- E.g. "And in case we sell out, I have an order in for another million units."