I know the relative pronoun, "which", only modifies the noun immediately preceding it, but if the noun is "X of Y", does "which" modify "X of Y" or just "Y"?
Increasing demand on the Chattahoochee River could alter the saline content of Apalachicola Bay, which... <--- does "which" modify "Apalachicola Bay" or "the saline content of Aaplachiocola Bay"?
Can someone please also explain the difference between "which" and "in which" and their usage?
As you clearly mentioned that 'which' modifies the noun immediately preceding it, it at times also refers to the entire sentence preceding it.
e.g. It emerged that Edna made the complaint, which surprised everyone.
Now, what is not clear here is that what is surprising? whether the complaint or that Edna made it. In these case, we look at the complete sentence preceding 'which'. So, here what is surprising is that Edna made the complaint.
Suppose the sentence that you have written is:
Increasing demand on the X river could alter the saline content of Y bay, which can be detrimental for the marine life.
So, here 'which' is indicating the 'increasing demand on X..'.
'in which' is normally used to introduce a relative clause after
a noun that refers to a place or time.
e.g. In the left drawer there is a wooden box, in which
my ring is kept.
I hope that clears some of your doubts, but if you can give the sentences that are confusing, then probably, a better explanation can be provided.
"Always....Read between the lines"