Best way to remove confusions with clauses is to identify dominant verb in the sentence. Then identify subject of that verb, then the object. Then identify all "extras". These "extras" are modifiers(phrases, clauses, etc).
With the exception of essential modifiers, you can remove all modifiers and sentence should still make sence.
Here is how to do it:
"It was anomalies in the orbit of Uranus that led to the discovery of Neptune. "
What is the word that is doing (dominant) or being (dominant) here?.
"was". And what was?, "it" was.
It was is thus main subject and main verb.
Next, "It was" but what? Ans--> "anamolies"
So now sentence is: "It was anamolies". (if you ignore pronoun-verb aggrement mistake, this will be a complete sentence, though wrong on GMAT). Correct sentence would be "They were anamolies".
Now to add more sense to it, a modifer is addded.
"It was anamolies
that led to the discovery of Neptune. "
This modifer is essential modifier. It brings a whole new meaning to sentence. Without it, even though sentence is complete, it would have different meaning. What does "that led to the discovery of Neptune. " modify ?. It tells more about anamolies, a noun(object).
Now a participle phrase is added to add more information.(This introduces an error of modifier placement).
It was anamolies
in the orbit of Uranus that led to the discovery of Neptune.
The participle gives more information about anamolies, it shows where exactly the anamolies are. This is
extra information by the way.
The main meaning of sentence does not change with or without it.
Now can you see what is modifier and why it is placed wrongly?.