One of the things that makes dinosaurs so appealing is their sheer size: plant eaters like Diplodocus and Brachiosaurus weighed well over 50 tons, and a well-toned Tyrannosaurus Rex tipped the scales at 7 or 8 tons. From the fossil evidence, it's clear that--species by species, individual by individual--dinosaurs were more massive than any other group of animals that ever lived (with the exception of certain genera of prehistoric sharks, prehistoric whales and marine reptiles like ichthyosaurs and pliosaurs, the extreme bulk of which were supported by the natural buoyancy of water).
However, what's fun for dinosaur enthusiasts can cause paleontologists and evolutionary biologists to tear their hair out. The giant size of dinosaurs demands an explanation, and one that's compatible with other dinosaur theories--for example, it's impossible to discuss dinosaur gigantism without paying close attention to the whole cold-blooded/warm-blooded metabolism debate.
So what's the current state of thinking about plus-sized dinosaurs? Here are a few more-or-less interrelated theories.
Theory #1: Dinosaur size was fueled by vegetation.
During the Mesozoic Era--which stretched from the beginning of the Triassic period, 250 million years ago, to the extinction of the dinosaurs at the end of the Cretaceous period, 65 million years ago--atmospheric levels of carbon dioxide were much higher than they are today. If you've been following the global warming debate, you'll know that increased carbon dioxide is directly correlated with temperature--meaning the global climate was much warmer millions of years ago than it is today.
This combination of high levels of carbon dioxide (which plants recycle as food) and high temperatures meant that the prehistoric world was matted with all kinds of vegetation--plants, trees, mosses, etc. Like kids at an all-day dessert buffet, sauropods may have evolved to giant sizes simply because there was a surplus of nourishment. This would also explain why certain tyrannosaurs and large theropods got so big; a 50-pound carnivore wouldn't have stood much of a chance against a 50-ton plant eater.
Theory #2: Hugeness in dinosaurs was a form of self-defense.
If Theory #1 strikes you as a bit simplistic, your instincts are correct: the mere availability of huge amounts of vegetation doesn't entail the evolution of giant creatures who can swallow it down to the last shoot. Evolution works along multiple paths, and the drawbacks of dinosaur gigantism (such as slow speed and the need for limited population size) can easily outweigh its benefits in terms of food-gathering.
That said, some paleontologists think gigantism conferred an evolutionary advantage on the dinosaurs that possessed it: for example, a jumbo-sized hadrosaur like Shantungosaurus would have been virtually immune to predation. (This theory also lends some credence to the idea that Tyrannosaurus Rex scavenged for its food--say, by happening on the body of an Ankylosaurus that died of disease or old age--rather than actively hunting it down.)
Theory #3: Dinosaur gigantism was a byproduct of cold-bloodedness.
This is where things get a bit sticky. Many paleontologists who study giant herbivorous dinosaurs believe that these creatures were cold-blooded, for two compelling reasons: first, based on our current models of metabolism, a warm-blooded Mamenchisaurus would have cooked itself from the inside, like a potato, and promptly expired; and second, no land-dwelling, warm-blooded mammals living today even approach the size of the large, herbivorous dinosaurs (elephants top out at a couple of tons, max).
Here's where the advantage of gigantism comes in. If a sauropod evolved to a large-enough size, scientists believe, it may have achieved "homeothermy"--that is, the ability to maintain its interior temperature despite the prevailing environmental conditions. This is because a house-sized, cold-blooded Argentinosaurus would warm up (in the sun, during the day) and cool down (at night) very slowly, giving it a fairly constant average body temperature.
The problem is, these speculations about cold-blooded herbivorous dinosaurs run counter to the current vogue for warm-blooded carnivorous dinosaurs. Although it's not impossible that a warm-blooded Tyrannosaurus Rex could have coexisted alongside a cold-blooded Titanosaurus, evolutionary biologists would be much happier if all dinosaurs had uniform metabolisms--even if these were "intermediate" metabolisms that don't correspond to anything seen in modern animals.