Encrypting data hides it. It does not prove the data was not changed. These are two different properties, and assuming the first provides the second is the root of a whole class of real vulnerabilities.

Why it holds

A cipher maps plaintext to ciphertext so an eavesdropper cannot read it. Nothing in that mapping detects tampering with the ciphertext. In CBC mode an attacker can flip bits and, given feedback on whether the result decrypts to valid padding, recover and forge plaintext without the key. That is the padding oracle attack, and it exists precisely because the system checked confidentiality but never integrity.

Where it breaks

The distinction disappears when you use authenticated encryption (AES-GCM, ChaCha20-Poly1305). There the ciphertext carries a MAC that is verified before decryption, so tampering is detected and confidentiality and integrity come together. The rule “encryption is not integrity” is a warning about unauthenticated modes, not about all cryptography.