Major stock indexes notched their best day in months Thursday thanks to mid-earnings season optimism fueled by a blockbuster report from Facebook parent Meta—though the gains were once again largely driven by a handful of mega-cap stocks.