To make it real simple, a TDR is a Transferrable Development Right.
Let's say you have a 60 acre farm. Half of it is "naturally protected" from development (ie. housing development) by steep slopes, swamp land, etc, leaving 30 acres of land that could actually be developed instead of farmed. Our zoning ordinance says you can sell 1 TDR for every 3 acres of land owned, that could otherwise be developed.
Now, in Walmart's case, they are using TDR's to build a bigger store than is currently allowed by our zoning ordinance. (The exact provisions, and formula's are published in the County's Zoning Ordinance at stmarysmd.com.) Without TDR's, the store cannot be expanded because that same ordinance limited the size of stores to prevent big box retailers from coming here. But by retiring the development rights on those 300 acres, Walmart can exceed the allowable footprint. (I can't even imaging how big 300 acres would be to look at, but an acre is 43,560 square feet, and when I cut my grass that seems like a lot - I wouldn't want to cut 300 of them!)
It's a pretty good deal for folks who want to preserve the rural character of St. Mary's County. In this case, the ordinance directs development and expansion to an existing commercial property, right on 235, in an area designed for commercial development. In exchange, 300 acres of farmland are preserved, somewhere out in the country. Presumably, a farmer (or several) have had their income supplemented by selling their TDR's to Walmart, which helps to keep them in the business of farming. And in St. Mary's County, the only folks who can save the farming industry, are the farmer's themselves.