For many years, New York City has been one of the few markets where all three legacy airlines -- American Airlines (NASDAQ:AAL), Delta Air Lines (NYSE:DAL), and United Continental -- have tried to maintain a strong position. (Los Angeles is the other main exception.)

Airlines' interest in New York is perfectly logical. It's the largest metro area in the U.S. and has a massive base of business travelers. However, a combination of capacity constraints at all three New York-area airports, high operating costs, and stiff competition makes it tricky to earn strong profits there. Recognizing this, American Airlines is reorienting its focus in New York, emphasizing flights to the most important business markets.

The pre-merger situation was a mess

Prior to its late-2013 merger with US Airways, American Airlines didn't have any hubs in the Northeast outside of New York. As a result, American was forced to do the best it could with limited resources at New York's LaGuardia and JFK airports.

In some key business markets, American Airlines did quite well. For example, it dominated the lucrative JFK-London Heathrow route along with joint-venture partner British Airways. The carrier also had a solid position on the key transcontinental routes from JFK to Los Angeles and San Francisco. However, other parts of its New York route network, such as nonstop flights to Tokyo's Haneda Airport, were big money-losers.

American Airlines tried to shore up its position in New York through an interline and frequent-flier partnership with JetBlue Airways (NASDAQ:JBLU). This allowed it to use JetBlue's larger domestic network at JFK to supply connecting traffic for international flights there. But cozying up to a major competitor is never a comfortable situation. And even with the JetBlue relationship, American still lagged Delta Air Lines in New York in terms of network breadth.

The merger changed everything

The merger with US Airways gave American Airlines another key asset in New York: one of two hourly shuttle services connecting LaGuardia Airport to Boston and Washington, D.C. (Delta operates the other shuttle service.) These routes are also popular with business travelers.

On the other hand, the merger made New York much less strategically important for American Airlines. US Airways had a major hub just 100 miles away, in Philadelphia. Today, American operates nearly 400 daily departures in Philadelphia, serving more than 100 destinations. By contrast, it has fewer than 100 daily departures at JFK Airport, and about 170 at LaGuardia.

For the past several years, American Airlines has struggled to make its Philadelphia and New York hubs coexist productively. One thing it did quickly was cancel the JetBlue partnership. It didn't make sense to be paying JetBlue for connecting traffic in New York when the new American Airlines could just as easily move that traffic through its Philadelphia hub.

Unfortunately, this further undermined American's position at JFK. However, the company felt that it didn't make sense to pull out of JFK entirely, because of the strong business demand for its London and transcontinental routes.

Slowly retrenching

American Airlines' adjusted pre-tax margin reached a record high of 15.3% in 2015, making it less urgent for management to make tough choices. By contrast, the company's adjusted pre-tax margin fell back to 9.1% last quarter and is still declining. This means that it is now critical for American Airlines to figure out a viable strategy for its Northeast hubs.

The result is that American Airlines is narrowing its focus to the top business routes in New York. In late 2016, the carrier announced that its flight from JFK to Manchester, U.K., and one of its two daily JFK-Paris flights would be operated seasonally. Last year, it made those cuts permanent, rather than just seasonal.

American Airlines will also end its flights from JFK to Zurich next month. Instead, it will fly to Zurich from Philadelphia: a route that it had cut during 2016.

In short, American Airlines is finally creating a sensible division of labor between its New York and Philadelphia hubs. In Philadelphia, it will operate a traditional hub-and-spoke operation to connect customers from across the U.S. to Europe. In New York, American Airlines is focusing on the nonstop routes with the most business demand.

Good news for Delta

American Airlines' decision to retrench in New York is helping Delta Air Lines consolidate its leading position in that key market. Delta is the largest carrier at both LaGuardia and JFK, allowing it to run more effective hub operations there. (Slot constraints are still a significant limitation, though.) Delta and its joint venture partners fly nonstop from JFK to all of the international markets where American has decided to cut back.

It's inevitable that American Airlines will lose some customers in New York as it cuts lower-performing international routes. However, maximizing the number of potential connections by concentrating flights in a few big hubs -- Philadelphia, in this case -- is a proven strategy for airlines. Thus, American's route network adjustments are likely to bolster its profitability.