Shares of semiconductor design and manufacturing company ON Semiconductor (ON 1.30%) have been on fire over the past year. Clearly, something is going right, because in the midst of a bear market, the stock is up 23% since the start of 2022 -- trouncing the iShares Semiconductor ETF's 23% decline over that same period.  

Onsemi handily beat its own expectations for the fourth quarter of 2022 as it continues to gain traction in the nascent electric vehicle (EV) and renewable energy industries. If you think greener cars and a more efficient energy grid will continue to pick up momentum over the next decade, Onsemi is a top stock to consider right now. Here's why.

A fantastic performance amid a bear market

Onsemi posted strong fourth-quarter (Q4) earnings results. Total revenue easily surpassed its own expectations and increased 14% year over year (management guided for 12% growth at the midpoint) to $2.1 billion. Especially impressive about this is that larger industrial chipmaking peers like Texas Instruments (TXN 0.25%) (3% decline in Q4 revenue) and NXP Semiconductors (NXPI 1.29%) (9% revenue growth) put in weaker performances in the final months of 2022.  

ON Revenue (TTM) Chart

Data by YCharts.

That isn't necessarily a knock against the competition, though. It's a tough market right now for semiconductor companies as the industry deals with a steep slowdown in consumer electronics sales. But Onsemi is nevertheless exhibiting strength. In addition to closing out a great 2022 -- in which full-year sales grew nearly 24% -- management's outlook for the first quarter says revenue could be down 4% to up 1% year over year. Not a blistering pace but relatively strong given the current state of the chip market.

For the sake of comparison, at the midpoint of guidance, NXP believes its sales will fall 4% this quarter, while Texas Instruments said revenue will decline 11%.

Onsemi is a top bet on EVs and renewables

What is Onsemi's secret right now? CEO Hassane El-Khoury and CFO Thad Trent took the reins a couple years ago and have been making hard decisions, selling off its low-performing fabs that make more commoditized parts and reinvesting into segments with higher growth and profit-margin profiles.

One key area of investment has been silicon carbide (SiC) chips, which are quickly becoming a key chip substrate for EVs and renewable energy projects given their better performance than pure silicon when subjected to higher voltage. Onsemi also makes analog sensors used in advanced driver-assist systems in cars and industrial robotics. All of these efforts are riding secular growth trends as companies race to create a more energy- and labor-efficient world.  

As the company has exited some areas of business, its profit margin has been on the rise, too. Onsemi still has a long way to go before it reaches the incredible performance of Texas Instruments, but El-Khoury and Trent are nonetheless making rapid progress transforming the company into a world-class chip manufacturer. 

ON Operating Margin (TTM) Chart

Data by YCharts.

Also in keeping with Texas Instruments' shareholder-friendly practices, Onsemi announced a new $3 billion stock repurchase program that lasts through 2025. That's worth nearly 10% of its current market cap. Paired with growth from secular trends like EVs and renewables, Onsemi could be poised to make quite the run higher in the next few years.  

Shares currently trade for 20 times trailing-12-month earnings, or 24 times trailing free cash flow. A lot of money is flowing into the EV and renewable energy markets, and Onsemi is thus far doing a great job addressing these hot areas while also balancing profitability.

Indications point toward the chip shortage for the auto market beginning to ease by the end of 2023 (auto chip fabs have been saying they are already operating at max capacity this year, crimping their growth prospects for now), so I'm being mindful of a possible downturn in 2024. Nevertheless, I plan to start buying shares in the coming weeks given the potential Onsemi has in EVs and renewables for the rest of the decade.