What if a pool of computers are used to attack a blockchain and modify it in 51% of the network?

I mean if a large computer pool is used to attack a blockchain and modify the copy of the blockchain in 51% of computers in the network.
Then due to consensus, the faulty blockchain will be replicated across the whole network. Thus changing the whole blockchain.