How does it happen? What motivated latin "parabola" to change into Spanish "palabra" and why does english "ask" is often changed to "aks"?
This is just a partial answer.
I think metathesis is often explained in terms of perceptual similarities between the variants. Additionally, sometimes we can say that one form has a "preferred" phonotactic structure. But in general, metathesis is known to be a difficult thing to explain in terms of linguistic theory.
The Spanish case is complicated because Romance languages are known to have processes of lambdacism/rhotacism that aren't metathesis-based (as amegnunsen mentioned in a comment; although I don't know of any specific Latin-to-Spanish sound laws that would be relevant here), and also processes of liquid dissimilation ("pelegrino" is attested as a variant form of peregrino, from Latin peregrīnus). So at first glance, it isn't entirely obvious that palabra is best analyzed as a case of long-distance metathesis. It's probably necessary to look carefully at the details of how this word and similar words developed in Spanish to determine whether it is a true case of metathesis (and if so, why/how the consonants metathesized). Unfortunately, I have not done this, so I can't say anything certain about the situation here. Ukemi's answer to How did 'cocodrilo' originate from 'crocodile'? gives other examples of liquid metathesis in Spanish (and also of other changes).
Changes between sk and ks have been somewhat common in the history of English, and can also be seen in Romance in various words, but I don't know what explanation would account for the presence of metathesis in the word ask. As mentioned in the Language Log post "Leaf-blower metathesis?", we see -ks variants in Old English, at a stage where the consonant cluster was intervocalic (as far as I can tell, in all forms of the word). In some languages, such as Faroese and apparently also Lithuanian, we see a process of metathesis of -sk- to -ks- before certain consonants that are added by inflection (the details differ between the languages; see "Metathesis: Formal and Functional Considerations", Hume 2001, for descriptions), but that doesn't seem relevant in the case of English ask; I don't know of any dialect of English that has a paradigm like /ask, asks, akst/. English speakers may show cluster simplification of the three-consonant word-final sequences /sks/, /skt/ or /kst/, but I don't think that's very similar to what we see in Lithuanian or Faroese.
Changes between sp and ps are also known to occur; e.g. in the word for wasp.
If we analyze the ask~aks variation as a example of synchronic metathesis in English, it's probably related in some way to the position of the -sk sequence in the coda of the syllable in the plain form ask. I don't think that any appreciable amount of English speakers produce /ks/ instead of /sk/ at the start of words. The only other example of /sk/~/ks/ variation at the end of a word that I can think of is asterisk, which has a (fairly stigmatized) variant pronunciation ending in /ks/.
As a sound change, there are very many ways for it to happen. In the case of "ask", the cause is lost in history. The OED indicates that forms like achsian, acsian are attested in Old English, and in Middle English gained popularity in the south and the midlands, but was considered vulgar. But this isn't a regular sound change, and in current English this example stands alone. Metathesis as a sporadic process in child language acquisition has been observed in Japanese; lateral metathesis presumably is related to the "localization" problem which also underlies lateral dissimilation, namely it is perceptually hard-ish to localize r vs. l in the speech stream, and the "surface template" (if there is such a thing) is that the lateral should be first, thus liquid dissimilation tends to favor l...r. The idea behind the perceptual account is that a listener knows that there are liquids but isn't entirely sure what order they are, and they default the the order l...r.