What happened

No investors like when one of their companies insists on plugging away in a market in which it's been failing. Thursday morning, Uber Technologies (UBER 1.84%) said it was retreating from two such situations, and a grateful market rewarded it by pushing its stock price more than 5% higher.

So what

Uber announced it will cease operations in Israel and close its food delivery business in Italy. The company said that it hadn't managed to build enough market share in the Middle Eastern country. The precise reasoning behind the Italy move wasn't immediately apparent.

In both markets, Uber is a runner-up. It is behind local companies Gett Taxi and Yango in Israel's ride-share market, while in Italy it lags rivals Just Eat and Glovo. 

Uber said that the Italy shift will affect roughly 50 of its employees, plus numerous independent delivery workers. No details on the potential impact of the Israel retreat were provided.

Reuters quoted an unnamed company spokesman as saying that the pair of withdrawals are "in line with our efforts to focus on markets where we have opportunities for sustainable growth."

Now what

Oftentimes in business, it's wiser to retreat from the battlefield than to sustain a losing fight. While neither market is significant compared to, say, the U.S., there's no reason to keep investing in them if they aren't producing returns.

This is not only good sense, it's entirely in line with Uber's strategy. The company's CEO, Dara Khosrowshahi, has previously said it will limit itself to investing in markets where it has a good chance to be the No. 1 or No. 2 operator.