@kelalaka's comment answers this very succinctly, but in the event that a slightly more in-depth explanation helps, here's my stab at it.
The initialization vector is to encryption as a salt is to salted-hashing/key-derivation. It ensures that if, in a given protocol, the same values are used multiple times, the output will still appear random instead of repeating.
With salted hashing (or key derivation) you are using a known deterministic process to generate an output value. The salt adds additional entropy to help ensure the result is apparently random. If the same value is hashed twice without a salt, the hash is the same. When a unique salt is added to each hash input, we help ensure that the outputs are different. Even if the output is coincidentally the same (usually extremely unlikely), we introduce doubt that the original input was the same.
Encryption needs to be reversible and, as a result, the algorithms are similarly deterministic. And, in many protocols, keys are re-used to encrypt many messages. In the event that the same message (plaintext) is encrypted twice with the same key, we risk revealing that fact by producing the same encrypted output (ciphertext). To avoid this, we include the initialization vector. When a unique initialization vector is used for each message, we help ensure that the outputs are different. And, again, even if the outputs are the same, the fact that a different initialization vector was used makes it extremely unlikely that the original message is the same.
Finally, it's also important to note that the IV being tied to a given act of encryption means that it is not always practical to agree an IV ahead of time, as you might for the key itself. In addition, if the key is still secret, getting the IV to your recipient is all that matters, as the key is what you are relying on to keep your encrypted data safe, not the IV. So transmitting the IV publicly isn't a problem. It's effectively just a parameter of the algorithm you used to encrypt the message.