What happened

Shares of Apple (AAPL -0.81%) were moving higher last month as the tech giant trended with gains in the broader tech sector as tech stocks bounced back from the collapse of Silicon Valley Bank and fears of a recession seemed to cool off later in the month.

There was no single driver of the stock's gains in March, though it benefited from high-profile analyst upgrades, previews of its upcoming mixed-reality headset, and signs that it's continuing to focus on cost-cutting.

According to data from S&P Global Market Intelligence, the stock finished March up 11%. As you can see from the chart below, the stock's gains tracked with the Nasdaq, but it rose more aggressively.

^IXIC Chart.

^IXIC data by YCharts.

So what

Early in March, the company got a number of bullish analyst notes. JPMorgan said that iPhone demand is high compared to Apple's competitors, while Jefferies also found that demand was strong.

Meanwhile, Morgan Stanley boosted its price target from $175 to $180, reiterating an overweight rating and citing "pent-up" iPhone demand and a reacceleration in its services business.

Shortly after that, Goldman Sachs initiated coverage with a buy rating and a price target of $199, noting the company's growing installed base of users. 

In the week of March 13, the stock started gaining again as tech stocks rebounded after Silicon Valley Bank collapsed, and reports confirmed that the company was planning to launch a mixed reality headset in 2023 as CEO Tim Cook pushed the company to release its device this year, according to Financial Times.

Bloomberg also reported that Apple was delaying some bonuses and expanding its hiring freeze, a sign it's expanding its cost-cutting efforts as it faces macroeconomic headwinds.

Among the big tech companies, Apple is the only one that has not announced major layoffs, but it's still a cyclical business. It can't escape the overarching in tech as recessionary threats have cooled off demand, and difficult comparisons have made growth numbers weak.

Towards the end of the month, the company also introduced its own buy-now-pay-later product, "Apple Pay Later," extending the reach of its payments business.

Now what

To start April, Bloomberg reported that the company is cutting a small number of corporate retail positions, another reflection of cost-cutting, and UBS said that iPhone sell-through was down 3% in February year over year, an improvement from previous months, but still a decline.

Apple shares are expensive, but its gains last month show investors are willing to pay up for quality. Even in tough times, the company appears to be strengthening its competitive advantages and putting distance between itself and challengers like Samsung and Alphabet, which should help support its elevated valuation.