If cars could fly, we would commute faster.
In this example, the verb "fly" is not in the past tense because the modal "could" can be used the past form of other modal "can".
So its meaning is the past tense and don't forget that you can't use a past tense verb form with "can" or "could".
If children got everything they wanted, they wouldn't learn the value of things.
This sentence says:
"Children wanted to get something and then they got it, which
means that there was no need to continue to want it. They had already gotten
what they wanted so their desire finished."
That's why "wanted" is used there.