This is a spelling rule that is also used for the simple past and present participle (-ing) forms of verbs. Generally, with CVC-end of word pattern, the vowel is short. However, CVCV... generally produces a long vowel sound. This is why the rule exists in the first place. (English being English, though, there are many exceptions.)
However, this rule does not apply to w, x, or y. When w or y appear at the end of a syllable or word, they usually act as vowels, not consonants. X in English in the middle or end of a word is pronounced /ks/, and acts like two consonants. CVCC patterns usually produce short vowels as well, so doubling is not required.
I hope this answered your question.