Let's first talk about the following two sentences:
1- Sara went to bed as soon as she had finished homework.
2- Sara went to bed as soon as she finished homework.
I think your confusion is valid because we use the past perfect when we talk about something that took place before another thing in the past. So the use of the past perfect comes across in the first sentence but the use of the past simple in the second sentence doesn't. Am I right? In fact, we don't need to use the past perfect unless it is necessary or unavoidable to do so. Even if we talk about one action happening before the other one, it is possible to use the simple past for both actions if we think it is not necessary to highlight or emphasize the happening of the earlier action. It sounds natural to avoid using the past perfect where the simple past works, which is used to refer to something or several things happening in sequence (one after another) in the past.
So both of the sentences are grammatically correct. However, I'll prefer the second phrase to the first one.
As for the last two sentences, it is correct to say that "everyone had gone home when Sara got to the party", but it's not grammatically correct to say that "everyone had gone home when Sara had got to the party". It doesn't make sense. In the past perfect when we talk about two events, we use the simple past in one clause and the past perfect in the second clause.
Let's now talk about the following sentence you are confused about:
"Everyone went home when Sara had got to the party".
There is nothing wrong with this sentence, but the meaning is other way round. It means that first Sara got to the party and then every one went home. Look at the
first sentence again. When Sara got to the party, everyone had gone home. Here it means that first everyone went home and then Sara got to the party. Sometimes, one action happens soon after the other action, here we should use the past simple in both clauses such as when Sara got to the party, everyone left, when they saw the police, they ran away, etc.
'
It's a bit complicated. And even though you can say that the basic use of the past perfect is to indicate an event that happened before another event in the past, it's not quite right to say that it's the only use.
Before touching that main point, let's take a look at your example sentence first.
In a general context, this sentence is more appropriate:
This tree was planted by the settlers who founded our city over four hundred years ago.
Was is in the past tense; founded is in the past tense. The past perfect is not needed because in this narrative, which is in the past tense, there is no need to indicate that the tree was planted before another event. However, context is king, and it can change everything. Consider:
Here is the town's monument. Besides the monument is an important tree. The monument was built in 1821. The tree had been planted by the settlers who founded our city over four hundred years ago.
Now we have a good reason to use the past perfect--to indicate that the tree was planted before the monument was built--i.e., it was planted before 1821 (it's unclear in what year it was planted, but it must have been at some point between over 400 years ago and 1821).
Back to your main point: is this (the past before past) the only use of the present perfect?
A straight answer is no.
Even though I don't have a complete list, and even though I don't want to touch more advanced subjects such as backshifting and narrative tenses (which don't imply time, strictly speaking; for example, a futuristic novel could be written entirely in past tenses), I can think of one good example: counterfactual conditional.
Here is an example sentence (taken from the Wikipedia page above):
If I had eaten more at breakfast, I would not have been hungry at 11am.
Though it's somewhat related to the idea of "an event that happened before another event in the past", it's not really the case, because in this case, it's "an even that hadn't happened before another event in the past". In other words, I didn't eat enough breakfast, so I was hungry at 11am.
Another point I'd like to make to wrap up this answer is, try to be flexible when learning English, think of those rules as guidelines rather than something set in stone, try to observe how people use these grammatical constructions in real life, and you'll be just fine. Happy learning! ;-)
Best Answer
Your book is correct. You've misunderstood the application of the rule.
The structure here is [ "before" + past perfect ], and presumably there is also a main clause in the simple past. This means "before" must come directly before the past perfect clause and subordinate it.
You give two examples where you believe the rule has been violated, but neither of those sentences has the structure [ "before" + past perfect ]:
Both sentences have the structure [ "before" + simple past ], so this rule does not apply here at all.
The general rule that always applies with "before" is this: if you have two clauses, and one of them is subordinated by "before", the other one always happens first. Where there's an apparent conflict, the word "before" takes priority over the verb tenses.