Serialization is described as a process in which the conversion of state of the object into byte stream takes place, while deserialization is the reverse process in which byte converts to object.
Now, the serialization at runtime attaches with each serializable class a version number which is referred as serialVersionUID. This identity is used during deserialization to verify that the receiver and sender of a serialized object have loaded the classes for that object which is compatible with serialization. So the use of serialVersionUID is to make sure during deserialization, that the same class is in fact loaded.
Coming on to the last part of your question as to the effect of wrong serialVersionUID, thing to understand is UID is generated automatically based on a few factors namely class name, implemented interfaces, all its public, protected members. If any of them are changed it will change the serialVersionUID. During deserialization, the receiver side JVM compares the UID associated with the object to the local class UID. If both unique UIDs match then only deserialization will be performed. Otherwise we will the error in form of InvalidClassException.