It's not directly addressed and the creators have deliberately not covered it.
Story Supervisor Scott Morse to Slashfilm.com
“We try not to go there. We just try not to go there. There’s a surreal level of disbelief that you’re having to jump already coming into the world where there are talking cars. We think we know what cars are in our world, and they serve a completely different purpose in the Cars world. They’re for transportation [in our world] and they don’t really transport each other in their world. So they become characters. We lean into that as much as we can and try not to get too hung up on the surreal nuts and bolts of it, I guess.”
There is, in-universe, however reference to "The Manufacturer" into which you can read what you will either indicating a deity or a life-giving creator who make "Cars" in a factory. It's, I suspect deliberately, vague.
Unconfirmed Quora comment from an alleged Pixar employee.
There's really no answer. When questions like this came up during production the conversation usually ended with someone saying "Ick".
The Cars world intersects ours where it's convenient for the story. There is no logic to it. So we see a "child" car once at the race, and other cars talk about "The Manufacturer".