The major indexes climbed higher again on Friday, and even though many media outlets paid close attention to the S&P 500 having climbed 20% from its bear market lows, the Nasdaq Composite (^IXIC -0.52%) had already recovered much more of its lost ground since last October. Friday morning's gains of about 1% for the Nasdaq showed continuing optimism about the stock market's resilience even in the face of macroeconomic challenges.

Indeed, the mood was so good that some Nasdaq equities hit all-time highs. Investors have gravitated toward artificial intelligence (AI) stocks, and both ON Semiconductor (ON -2.39%) and Super Micro Computer (SMCI -3.29%) have hitched their wagons to the AI trend. Here's why investors are excited about both companies.

Making cars smarter

Shares of ON Semiconductor were up more than 1% in early trading. The semiconductor manufacturer has concentrated much of its attention on the automotive market, particularly the efforts of auto manufacturers to produce autonomous driving systems.

ON Semi's chips and components are geared toward multiple facets of autonomous driving. Whether you're looking for parking assistance capabilities, lane departure warnings, collision avoidance systems, advanced braking, or simple cameras that give drivers more awareness of their surroundings, ON Semi's memory chips, analog switches, microcontrollers, and sensors have become must-have items for aspiring automakers. Moreover, ON Semi has also benefited from other automotive trends, including infotainment offerings, power management systems, and in-vehicle networking.

Beyond autonomous driving, ON Semi is also poised to benefit from the trend toward EV adoption. Its power systems know-how could help the company provide better solutions over time for EV charging. Given the challenge that range anxiety represents to potential EV buyers, a solution from ON Semi could change the industry.

Best of all, unlike many tech companies, ON Semi is currently profitable and even trades at a reasonable multiple of about 20 times next year's estimated earnings. That suggests that even at a record stock price, ON Semi could still rise further.

Super Micro looks like a super stock

Meanwhile, shares of Super Micro Computer jumped another 5% Friday morning. That brought its year-to-date gain to more than 200% as more investors become aware of the hardware company and its potential relevance in an AI-driven market.

Super Micro has gotten on investors' radar as a result of its association with key players in the AI space. Its business centers on server and data storage system technology, and it is aiming to innovate in all the hottest growth areas, including cloud computing, enterprise transformation, AI, 5G infrastructure, and the metaverse. It has close partnerships with Nvidia (NVDA 0.76%), whose success has led some investors to see Super Micro as a follow-on play.

Some have criticized Super Micro's move higher as AI-based hype, especially since hardware-centric businesses generally haven't found long-term success. However, given its massive growth in profits, the stock still trades at reasonable multiples, and many see plenty more room for expansion in the immediate future.

Investors have had to deal with bear-market conditions for a long time. If they see the opportunity for a broad-based rebound, they're apt to take it -- and that could help stocks that are already hitting new all-time highs gain even more ground in the months and years to come.