Microsoft's stock market value surpassed Apple's for the first time since 2021 on Friday, making it the world's most valuable company.