You're right that in written form, the comma makes a big difference in interpretation:
She didn't come home, because it was raining.
This means that she didn't come home, and the reason she didn't come home was because it was raining.
It's the same as if there were two difference sentences, or if the sentence was reversed:
She didn't come home. Because it was raining.
Because it was raining, she didn't come home.
She didn't come home because it was raining.
This means that the reason she didn't come home was because of something other than the fact that it was raining:
She didn't come home because it was raining, but because she remembered she'd left the stove on.
In verbal communication, there are generally two indicators that distinguish between the two versions:
In the first version, there is a slight pause in speech between home and because. Normally, there is a 1–1 correspondence between a written comma and a verbal pause—although this is not always the case. The pause can also be shown by making it two complete sentences.
In the second version, if the reason is not the rain itself, emphasis will commonly be put on the word because or the word raining—although that is also not always the case:
She didn't come home because it was raining.
She didn't come home because it was raining.
If there is neither pause nor emphasis to signal the meaning, then it's only possible to infer the meaning from context. But if that's not possible, then the only recourse is to ask the person what they meant.