I have worked in conventional dairies, as well as with beef cattle. Very large dairies (like those you see across the southwest) keep their cattle in large dirt lots outside all the time, except for milking, with access to shade from the sun. In colder areas, they are still outside, but have access to shelter in the form of freestall barns (large barns, usually bedded with sand, that the cows can go into an out of stalls at will). The cows are basically confinement-kept, but yes, they do technically get to see the sunshine.
Dairy cattle are fed a very highly concentrated diet; it usually consists of some sort of grain (corn, cottonseed meal, soy, wheat, etc.) and roughage (silage, haylage, etc.). Depending on the size of the dairy, cows will receive hormone shots and regular antibiotics. Smaller dairies may not do regular antibiotics, as they know their cattle better, and don't usually medicate unnecessarily (too expensive). Dairy cattle have a fairly short lifespan, usually less than 8 years; in large dairies, it is shorter, as it's cheaper to just replace the cow than to spend much money on treating her. In smaller dairies, the farmer will often take the time and money to treat a cow (esp. if she is a good producer), before just shipping her out to slaughter.
Beef cattle do spend a large part of their lives on "pasture", but considering the average life of a calf destined for freezer paper is only about 15-18 months, that's not really saying too much! Pasture may just mean a really big dirt lot shared by lots of other calves after weaning. It may mean rangeland, a wheat field (new, not ready for harvest), or good quality grass.
Once weaned (around 6 months, on average), calves destined for feedlots are usually "preconditioned", which means they are implanted with a growth hormone, vaccinated, and dehorned and castrated (if applicable). They may spend the next 5 or 6 months on pasture, and then go to a more concentrated feedlot where they are fed very high protein feed (read corn, soy, cottonseed meal, etc.) to encourage rapid weight gain. Some producers shorten this time frame to have calves finished out by a year.
Lamb is usually grass-fed, for a couple of reasons. First, lambs go to slaughter very quickly, well before a year of age. They don't need very much, compared to cows, to finish out. Second, lambs really don't tolerate a high grain/concentrate load very well. It shuts down their gut and kills them if fed in too large a quantity. Because of that, most lamb, even that found in your local grocery store, is usually not grain-fed, implanted, or treated with antibiotics.
This is my experience with the beef/dairy/lamb industry. I'm sure there are people with other experiences that will contradict mine, as farming/ranching practices tend to vary by region.
I agree with PP, that you have to go with a "better than" approach. If you are fortunate enough to be able to afford high quality meats, excellent. If you aren't, then take the "better than" approach to make sure you get the biggest bang, nutritionally speaking, for your buck.