Apple beats Elon Musk’s xAI in race to buy Prompt AI, aiming to strengthen its artificial intelligence technology.