The first "az" stands for the English "that". And, unlike English, the "that" word is always followed by a definite article in this kind of construction. So, literally, you are saying this: "This (is) not that the car". This is just how Hungarian works.
In contrast, "These are not those cars" would be:
"Ezek nem azok az autók".
And "Those are not these cars":
"Azok nem ezek az autók".