"It is not the car that is there, but a girl."
Translation:Nem az autó van ott, hanem egy lány.
In this sentence, it has to do with what is being denied/negated. Whatever is closest to "nem" is being negated.
Nobody disputes the "ott", "there", part. We all know that something is there. But it is not the car but a girl instead. So, "ott" gets as far away from "nem" as possible.
Nem az autó van ott, hanem egy lány.
It is a bit difficult to explain. There is the question of emphasis in place, and also some changing word order in a negative sentence.
But here is a simple sentence:
"Az autó ott van" - "The car is there" - very neutral statement.
"Az autó van ott" - "It is the car that is there" - The car is being emphasized, it is the car, not something else, that is there.
The above sentence is the negation of this latter sentence. "It is not the car that's there".
"Nem az autó van ott."