It's no mystery why retailers and their vendors sink time and money into charities.

In fact, it's kind of transparent.

Sure, they want to do good. But they also want to do well. So they target philanthropies and causes that might appeal to their core customer. For Target, it's Mom, hence the discount chain's support of school- and child-related charities, among others. For Gillette, there's Dad, which is why the company adds prostate research to its list of cancer groups supported.

"Support" comes in various ways: writing checks to national nonprofits, sponsoring walkathons to raise money for AIDS research, donating a few cents of every purchase toward buying computers for the classroom.

Even giving away mattresses.

Slumberland, a St. Paul, Minn., furniture chain, plans to donate 1,500 of them this year to destitute people without beds. Area charities find people in need and Slumberland provides the mattresses, as it has every year for the past decade during the holidays.

Does the giveaway, and all the publicity it attracts, drive traffic into the stores? David Rosenbrook, who handles the event, thinks so.

"There are some consumers who are only price-driven," Rosenbrook said. "But there are a lot of people who look beyond that and try to support retailers who support the community."

Plenty of research backs that up.

If two retailers offer the same prices and quality, two-thirds of consumers say they are likely to switch from Retailer X to Retailer Y because the latter supports a worthy cause, according to marketing firm Cone LLC, citing 10 years' worth of research.

About 43 percent of consumers say it is "extremely important" to them for places they shop to behave like good corporate citizens, surveys from America's Research Group in Charleston, S.C., show.

So it's no wonder retailers hire consultants to strategize and brainstorm about the options. Which charities to invest in (breast cancer or literacy)? How many? (Wal-Mart writes checks to at least 100,000 organizations a year.) And, perhaps most important, how much. (Target donates 5 percent of its pretax profit to charity every year.)

They hire folks like Robert Passikoff, president of consulting firm Brand Keys Inc., to try to determine how much consumers value corporate backing of particular causes, which he does through surveys. One of Passikoff's findings: The corporate image of women's apparel chains gets a bigger lift from sponsoring charities focused on breast cancer issues than those working on childhood disease.

"Long gone are the days when the chairman's wife made the decision," Passikoff said. "Retailers work as businesses, not charities."

It wasn't always this complicated. Back in the 1930s, '40s and '50s, when more retailers were family-owned businesses that ran a single store or a mini-regional chain, charitable giving was much more driven by community relationships.

"Historically, retail has been in Main Street," said Katherine Mance, vice president of the NRF Foundation, the research arm of the National Retail Federation. "When raising money for schools, baseball boosters, high school plays, I remember people would walk up and down Main Street. Retailers were the natural ones to ask for money, and they responded generously."

Then came the advent of big stores and large national chains, and the number of stores grew. The emphasis shifted. Retailers began using charitable work to raise their visibility as they entered new markets, to gain an edge over rivals, or to meet a specific business need, such as winning support for an irksome zoning issue.

That's not to say they're no longer generous. Remember the outpouring of assistance following the Sept. 11, 2001, attacks? Mance's foundation received $1 million checks from at least five retailers within an hour of the attacks, to dole out to local agencies helping out at Ground Zero. Starbucks gave out free coffee to rescue teams at the Pentagon. Pet store owners donated booties to protect the feet of the dogs involved in rescue efforts.

But as retailers have become more savvy about "cause marketing," so have consumers, said Mark Feldman, executive vice president of cause-branding at Cone.

"What really makes a difference with consumers is the genuine nature of the commitment, that it's authentic and credible, that the employees are involved and can engage in conversation about it," Feldman said. "People must have a reason to believe that it's not the sales promotion of the month."

C. Britt Beemer, founder of America's Research Group, said no matter what the approach, he always advises retailers to "do it in a big way" to get the most impact.

"Don't just sponsor one person in a 10K race, sponsor the 10K race," Beemer said. "You don't get credit for being one of 15 company sponsors at the bottom of a list."

And no company does it bigger than Wal-Mart. The nation's largest retailer is also the nation's largest giver of corporate cash. Through the Wal-Mart & Sam's Club Foundation, Wal-Mart this year will raise $158 million for communities where it has stores. That's $18,000 an hour, or $5 a second for every day of the year, points out Dan Fogleman, a company spokesman.

About 90 percent of the donations are determined at the local level.

"We empower our store managers and associates to determine where we can have the greatest positive impact," Fogleman said. "Our associates live and work in these communities. It just makes sense."

And that leads us back almost full circle to the roots of corporate giving. Retailers now figure that perhaps giving locally, again, plays to their advantage.

"They're looking at the impact on their local stores and local communities and local families," said Chris Ohlinger, chief executive of Service Industry Research Systems Inc.

The most successful charity campaigns generate an extra 2 to 3 percent in sales, Ohlinger estimates. If that sounds small, it's not.

"That's the difference between a really successful holiday season and a really bad one," Ohlinger said.