WIESBADEN, Germany, July 31 — Three days after Wal-Mart Stores announced that it would pull out of Germany, Roland Kögel was wandering through the aisles of a somewhat threadbare Wal-Mart in a strip mall in this western German city.

“Why are they giving up now?” he asked. “They have good prices and a good variety of products.”

Yet Mr. Kögel, 54, confessed that he never bought groceries at Wal-Mart. Food is cheaper at German discount chains. He also does not visit this store often, because it is on the edge of town and he does not own a car. His one purchase for the day was tucked under his arm: a neck pillow.

Shoppers like Roland Kögel help explain why Wal-Mart raised the white flag in Germany, the site of the company’s first foray into Europe.

After nearly a decade of trying, Wal-Mart never cracked the country — failing to become the all-in-one shopping destination for Germans that it is for so many millions of Americans. Wal-Mart’s problems are not limited to Germany. The retail giant has struggled in countries like South Korea and Japan as it discovered that its formula for success — low prices, zealous inventory control and a large array of merchandise — did not translate to markets with their own discount chains and shoppers with different habits.