I wrote a chapter on how cryptocurrencies work and what a 51% is in a hopefully approachable manner[0].
Basically the security assumption in Bitcoin is that at least 50% of miners are honest and work for a profit. A 51% attacker can recreate the latest blocks and remove all transactions from them, effectively the ability to reverse payments.
Hypothetically the government can gain 51% hashrate. For example China could take control of all miners there (currently more than 50%) and use them to attack the chain.
This type of attack can be detected. An extreme type of defense is to change the proof-of-work algorithm, making all existing miners worthless. This has been done several times in Monero for example.
[0]: https://whycryptocurrencies.com/how_do_cryptocurrencies_work...