how does an initialization vector work? Can somebody please explain how an initialization vector works.

My current understanding is that it is used to prevent 2 of the same messages looking identical after encryption, but isn't this the same as what a salt does?

How is it different from a salt?
Indeed both have the aim to prevent same messages "encrypting" to the same plaintext.
The difference is the context.

People speak about using IVs if they want to use them in blockcipher modes, like CTR or CBC.

People use the word "salt" if they want to refer to something that is stored in public but must be somewhat random and large. Usually this applies mainly to password hashing schemes like scrypt or bcrypt.