First of all, it’s pronounced ‘wa’, but it’s spelt ‘ha’=は. It’s a special spelling rule. Probably some remnant of old spelling conventions/pronunciations. Just a friendly reminder. I know it takes time to get used to.
As for the examples you gave… I could be wrong, but I think that くるまがなんですか is very unnatural in most cases. For that matter, I think the two sentences that you’ve presented illustrate exactly why は is the topic marker, and not が.
は is used to raise a point or idea for discussion, and is usually used for things that are already known to those in the discussion. It can also be used to contrast two or more people or things. Some websites liken it to a spotlight, but I think a more helpful analogy is the colon (:). 「Aは」could be quite accurately captured by the following structures:
- As for A
- About/regarding A
が, on the other hand, specifically points to someone or something, and indicates that they are something or are doing something. It often indicates that that particular person or thing is the one doing something, often the only one.
A final point that’s a consequence of sorts of these differences: が tends to place emphasis on what comes before it, while は places emphasis on what comes after it. As such, if we use these ideas in order to analyse the sentences you’ve presented:
This is the typical everyday question: ‘what’s XYZ?’ Here, ‘car’ is the topic, and what you want to know is what it is. Because that’s usually how things go when you ask ‘what’ something is – i.e. everyone in the conversation has heard of that ‘something’, so the word is common knowledge, but the concept behind it might not be –, this is the more natural sentence.
The first thought I had when I read this sentence was to parse it as ‘A car is なん, is it?’ I couldn’t think of anything sensible. However, then I remembered a line from an anime I watched two years ago: 「『パー』がなんだって？」(‘What do you mean, “poof”?’ – Konosuba Season 1 Episode 1) Based on that, I think this sentence would only make sense if you wanted to emphasise ‘cars’ (and nothing else) as the focus of your question. Maybe something like ‘Cars are what?’ I saw quite a few instances of 「それがなんですか」being used to express dissatisfaction on Google, basically meaning something like ‘what the heck is that (supposed to be)?’
Honestly though, I think this probably isn’t the best sort of sentence for analysing the differences between が and は. Here’s a page covering most of the things you might want to consider: http://www.japanese-language.aiyori.org/article1.html There are other resources that are perhaps a bit more complete or helpful, but they’re in Japanese. Here’s the translation for one of them: https://forum.duolingo.com/comment/3555911. The English isn’t great, but it should be comprehensible.