One is not better than the other, and they're not terribly comparable. It's like comparing a metal fork to a large supply of disposable chopsticks.
Here are some areas where they do compare, though:
- Efficiency.
Foliar sprays are far and away more efficient, if you use a pump sprayer. Most people probably don't use pump sprayers, though. Foliar feeding via a hose isn't terribly efficient when it comes to fertilizer (and is actually fertilizing the ground, too).
- Burning plants.
It's a lot easier to burn plants with a foliar spray if you don't know what you're doing, or if you don't have experience with spraying that fertilizer on that plant, yet. Knowing the correct application rates is very helpful.
- Nutrient availbility in the soil (pH, etc.)
Foliar sprays circumvent this and give the nutrients directly to the plants. Fertilizing the ground might influence that balance, but you still have to deal with the consequences of that balance on your fertilizer.
- When you can use them.
You can fertilize the ground whenever you want, pretty much. Foliar fertilizer sprays need to be applied when the sun isn't out. Also, less commonly known is that plants don't seem to use some fertilizers in foliar form when it's too not warm enough (e.g. calcium nitrate on tomatoes).
- Rain.
You can't apply foliar sprays in the rain, and it doesn't do much good to apply it before it rains.
- Fungus.
Different methods may promote different kinds of fungus in different contexts. In theory, getting stuff wet can contribute to more fungus (although drought-stress can also give disease opportunity, I've found). Not every fungus is the same, and some of them (like Verticillium) are complicated. Pre-fertilization probably wins out here, because you're not putting water on your plants: the fertilizer is already there. As long as the roots aren't severely overwatered and the leaves aren't staying wet for extended periods of time, you'll probably be okay, most of the time.
- How long it takes plants to respond to the fertilization.
Plants respond to foliar sprays faster. However, they respond to soil fertilization longer (often; maybe not 100% of the time; foliar applications of potassium sulfate when the plants are already large can last a long time).
I could go on, but I have to go.
The moral of the story is get some non-threatening experience (more than a little) if you really want to understand the ins and outs.
I mentioned pre-fertilization above. That's another way of fertilizing altogether. The idea here is to add a significant amount of fertilizer to the soil some time before you ever actually plant anything, so you don't have to fertilize during the season. I like this method because you only have to do it once. It saves a lot of time and effort. It seems quite effective. However, you run the risk of adding too much, raising the salt index of the soil too high; some plants might burn in this context.
I experimented, trying pre-fertilization this year (using 24-8-16 Miracle Gro). It worked very well for my peppers (which are mostly big bell peppers), and for some tomato varieties (such as Brandywine Pink). I probably added too much for some of the tomatoes, though. Pre-fertilization worked well for container watermelons last year.
In my experimentation with pre-fertilization in the ground, I was a little worried the fertilizer might all leach through and disappear long before the season was out, but that didn't happen with the all-purpose fertilizer.