Yeah, the word-for-word issue is actually pretty cool. I suspect most of the time it is the difference between the original dialog written for the scene and the dialog that eventually made it to broadcast -- changed either during filming or via dubbing, in post-production. Often, I've noted, it is a matter of an inconsistency in the dialog as originally written: Early in the program they refer to the ex-husband as "John" but later in the program they refer to the ex-husband as "Paul"; that'll often get corrected via dubbing in post-production, but the closed captions apparently don't receive such scrutiny for continuity errors. Sometimes the changes are more subtle, perhaps being a matter of what the director, at the time the scene was filmed, or perhaps in post-production editing, decided would make better sense, or help make the whole program work better as-a-whole.
Anyway, since marrying a hearing impaired person thirteen years ago, it's been a eye-opener. It amazes me how often there are such changes made to dialog. It's actually sometimes pretty funny how arbitrary some of the changes seem to be.
The not-in-sync issue is completely different, likely due to an inconsistency between processing of the audio and video feeds... much more complicated stuff that I don't understand as well.