Apple has overtaken Nvidia as the world's most valuable company, fueled by AI investments and strong hardware and services revenue. The rivalry persists as both excel in different sectors.