Some of the other big tech companies have or are able to have just as much, if not more cash, than Apple:
https://www.capitaladvisors.com/research/war-chest-exploring...
They just don’t want to bet they can deploy it successfully in the hardware market to compete with Apple, so they focus on other things (cloud services, ads, media, etc).
Google is not a hardware company (outside of the Pixel lineup where they just take some white-label ODM design).
Microsoft has a bit more hardware sales exposure from its consoles, but not for PCs. They don't have a need for revolutionary "it looks cool" stuff that Apple has.
Amazon, same thing. They brand their own products as the cheap baseline, again no need.
And Meta, all they do is VR stuff. And they did invest(ed?) tons of money into that.
The point is they have enough cash to make an attempt to be whatever company they want. Apple chose to delve into hardware, the others chose not to, not because they don’t have the cash.