Generally speaking, in two different ways: (a) cipher modes will usually use a combination of initialization vectors, block chaining, or an incrementing counter to perturb the encipherment of each block so that repeated data does not result in repeated ciphertext and (b) encrypted protocols will include a section to be filled with random "nonce" data so that repeatedly enciphering the same message will also result in different ciphertext, and might also add random padding so that the length of ciphertext can't be used to deduce the length of a particular message.
Modern cryptography solves this by using randomness (IVs, nonces, padding, salts) so that even identical plaintexts encrypt to different ciphertexts, eliminating predictable patterns.