They buy hardware, replace it as the years go on, and continue doing business.
The investment isn't just in raw compute - they have to build buildings, pay staff, and other things. For the hardware and software - they just keep pace as all the other computing companies have to.