It's true that buying 51% hash power would cost far more than $4B. Some people assume that you could rent 51% hash power for a short time (like a day) to do the attack.
According to ChatGPT (bad source I know but can't find it anywhere else), the entire value of the entire mining network is about $6B. What do you think it is?