I assume you are asking what historical change gives rise to metathesis. There is no single answer. One source (Leti) is a combination of stress shift, vowel harmony, and syncope of unstressed vowels utterance-medially. Another (Hebrew) is that affixation can give rise to unsyllabifiable consonant clusters which are resolved by metathesis. There is also place-based contact metathesis, where C.C is reordered in case of certain place of articulation combinations (coronal-labial is, I guess, a "dispreferred" output). You can get #VC → #CV when a language disallows vowel-initial words. Basically, you can always come up with a post-hoc story about why any sound change happens, but to know whether the story is actually correct for a particular case, you would have to look at the historical details of a specific sound change.