I am currently reading a book called Serious Cryptography written by Aumasson to learn about Security. There was a paragraph talking about the security goal named indistinguishability (attached below), which reads in the section "Security Goals":
I've informally defined the goal of security as "nothing can be learned about the cipher's behavior." To turn this idea into a rigorous mathematical definition, cryptographers defined two main security goals that correspond to different ideas of what it means to learn something about a cipher's behavior:
Indistinguishability (IND) Ciphertexts should be indistinguishable from random strings. This is usually illustrated with this hypothetical game: if an attacker picks two plaintext and then receives a ciphertext of one of the two (chosen at random), they shouldn't be able to tell which plaintext was encrypted, even by performing encryption queries with the two plaintexts (and decryption queries, if the model is CCA rather than CPA).
Non-mallleability (NM) ...
While I understood that the point is to make it infeasible to point out which plaintext is encrypted when randomly given the ciphertext from one of 2 plaintexts.
I don't know how it is infeasible anymore when the attacker can now perform encryption/decryption queries on the given plaintexts as mentioned in the paragraph. Why can't they just encrypt both given plaintexts and then compare them with the given ciphertext?