committee and commitment
Committee has a double* t because any word ending in it has the t doubled when followed by a vowel (other than ‘silent’ e.
Commitment* has one t because the t is followed by another consonant. This ‘stops’ the momentum of speech so that a double t looks odd.
Your question is interesting because the root word in Committee and Commitment is same i.e. commit.
The answer lies in the phonics of word commit. The commit is the C V C word i.e. Consonent-Vowel-Consonent. You can learn more about CVC words at https://www.theschoolrun.com/cvc-words .
So, when you add a suffix which begins with vowel (in our case -ee), you have to double the final consonant of the root word (our root word is commit and it surely ends with consonant 't')
commit + -ee = committee [Root word: commit ends with consonant and suffix: -ee starts with vowel]
In other case, when you add a suffix which begins with consonant (in this case -ment), you do not have to double the final consonant of the root word (remember our root word is commit).
commit + -ment = commitment [Root word: commit ends with consonant and suffix: -ment starts with consonant]
I hope it helps!