l'électeur posted a superb answer already, but I would like to add on this part.
まま is one of those things that fills me with dread whenever I see it
in a sentence. [...] Does anyone have a good way to understand まま in
general?
So far, the model that helped me the most to understandn まま, as a learner, is the one that follow. Note that this model is quite opiniated, and native speakers and linguist probably have one much more nuanced, but for learners I think it's an effective first approximation.
- まま is a noun. Probably the key takeaway of this model. It's not a
weird part of speech or exception, it does not break the grammar of
japanese, it's not scary, it's just a noun that work almost like every other noun.
- This noun means "unchanged condition". Everytime you see まま you can
replace it by "unchanged condition". ("unchanged state" is also ok.)
- The で after まま can be seen as the te-form of the copula. But まま is a
bit special and the で can sometimes be also dropped.
Let's test this model. If まま is a noun, then like every other noun まま can :
1) Be qualified by another noun : nounのまま
「自然のままの森。」
Nature's unchanged condition's forest. A forest in the unchanged condition of nature.
In more natural english, a forest it its natural state. Unspoiled woods.
「そのままでお願いします。」
being in this unchanged condition, please.
Just like this, please. As is, please.
Very useful sentence to use in combini. When buying food, the cashier will usually ask if we want them to warm it, or if we need a bag, chopstick etc. If we need nothing, if we want the food as is, in its current unchanged state, we want it そのまま. In this unchanged condition.
2) Be qualified by an i-adjective
「いつまでも若いままでいたい。」
Being in the unchanged condition of forever young, I want to exist.
I want to be young forever.
The literal translation is very clumsy in english, but in japanese it's just a regular i-adj+noun 若いまま.
3) Be qualified by a complete cause
「テレビをつけたまま寝てしまいました。」
Being in the unchanged condition of TV turned on, I felt asleep.
I felt asleep while leaving the TV on.
Note that the qualifying clause ends often with a verb in the ta-form, because the action of turning on the tv is already complete. We are in the unchanged condition of this action done.
「仰向けになったままで、ハリーは今まで見ていた夢を思い出そうとしていた。
仰向けになった = lying on his back. Well, literally it's "became face-up". Instead of focusing on the state, like the english does, the japanese focus on the change from "not on one's back" to "on one's back". But if you changed to facing up, now you are currently lying on your own back.
being in the unchanged condition of became face-up...
While/still lying on his back...
And about the example mentioned by l'électeur :
「あの人は5年前にインドへ渡ったままです。」
With this model, this sentence is analysed very simply as a regular "qualifying clause + noun + です"
It's the unchanged condition of "that guy went over to India 5 years ago".
Because まま is an unchanged condition, he is still in India.
By the way there are also some extended meaning of まま, like in 思いのまま, わがまま, but it's out of scope here.