Hmm...you just asked a very basic question, about a very complicated subject. I have books on growing our beloved, plant where there are whole chapters devoted to what you are asking...but I'll throw in my two cents.
IMO, one is not better than the other, they are just different. Each method has it's own set of advantages (and disadvantages for that matter). So it is going to depend on what you are after.
Out plant will grow almost anywhere if given a chance, I've seen it growing in a crack in a parking lot...so for a new grower, it's hard to beat soil for it's simplicity. Then, once a grower really knows what he/she is doing, you can grow some of the dankest, stickiest, tastiest nugs you've ever seen, with organics in soil. In fact, some would say the only way to develop the full profile of terpenes possible in some strains is in soil.
One of hydro's advantages is growth rate and yield. Hydroponic nutrients are already in a state that can be used immediately by the plant, so it can grow faster. In soil, bacteria and fungi break down certain compounds and make them available to the plant. So, in essence, if you want to grow the very best buds in soil, you need to feed the soil in addition to the plant, in hydro you only feed the plant.
If you are growing hydroponically it's much more hands on (there are exceptions). your garden will be very dependent on timers and pumps all working correctly. And a power outage can spell disaster! Also, problems must be recognized and corrected quickly in hydro, and a poorly maintained setup that clogs and overflows, or has a hose that comes loose or breaks can lead to catastrophic water damage.
One exception to many of the problems and difficulties that can occur in hydro is a method called hempy (named after the individual that made the style popular). It's basically a passive hydroponic system where the plant is growing in a bucket with a hole in the side, filled with some type soilless media (some combination of perlite, vermiculite, etc), and water/nuts are added by you much like watering a plant in soil.