Investors can learn a lot from the stocks that generate phenomenal returns over a relatively short timeframe. For instance, in the past year, we've learned once again that cash flow is king and companies focusing on what they do best is important. 

Three great stocks that exemplify these particular lessons are Ferrari (RACE 2.49%), with its 64% gain over the past year, Transocean (RIG 2.27%) and its 49% jump, and General Electric's (GE 0.68%) 72% rise. These three have been magnificent stocks and the companies behind them are the reason why.

1. Ferrari leans into a premium niche

One of the top-performing auto companies in the world over the past year is Ferrari, and it's not because the company is transitioning to electric vehicles (EVs) or adding products in new markets. This is a company that's focused on the high-end performance niche in automotive and charges a premium for its products.

You can see below that Ferrari's operating margin is second to none in the auto industry and they're not declining like some competitors.

RACE Operating Margin (Quarterly) Chart

RACE Operating Margin (Quarterly) data by YCharts

As great as Ferrari's performance is, the stock returns have outpaced the business. You can see below that the company grew revenue over the past five years as well as net income, but most of the stock's recent gains have come from market enthusiasm over the expansion of several multiples, including its price-to-sales ratio. The question now is whether or not there's an upside from here.

RACE Chart

RACE data by YCharts

This is an expensive stock at 49 times trailing earnings, so it's priced for perfection. And as magnificent as the business is, that's the one reason I think the great returns for Ferrari may not continue.

2. Transocean is back

How does a company that's losing money see its stock rise 185% in three years? Despite Transocean's recent underwhelming past performance, it's not past results investors are looking at. The market appears to be focused on the future growth potential.

RIG Revenue (TTM) Chart

RIG Revenue (TTM) data by YCharts

The third quarter of 2023 was the sixth consecutive quarter of increasing order backlog for the world's largest offshore drilling contractor, which now stands at $9.4 billion. Cash burn has dropped dramatically and it looks like demand for offshore drilling rigs is returning rapidly only a few years after companies were scrapping rigs.

This is a cyclical business and the cycle is working in investors' favor right now. 2024 will be the time to show these valuations are justified, but quarterly results are showing a lot of momentum in the right direction.

3. General Electric gets focused

GE has been on a massive transition over the past decade, breaking apart a once-dominant conglomerate with business segments that spanned from energy to finance. The last major transition underway for a slimmed-down GE is spinning off the remaining pieces of the energy business to focus on aerospace and investors have been cheering the progress.

For the remaining aerospace business, operations are going incredibly well. Third-quarter results showed a 34% increase in orders year over year and a 25% jump in revenue as commercial orders continued to rise. As global airline orders continue to be strong and military spending increases, GE is well-positioned to continue its growth trend.

For decades, GE was a conglomerate that seemed to be less focused every year. Splitting into three distinct companies and selling some assets has worked wonders for investors.

The key to magnificent returns

Each of these market-beating stocks demonstrates that focusing on what you do best is critical to success. It doesn't hurt to have some tailwinds from the market broadly, but those tailwinds could be lost without focus.