In the Massoretic tradition there is a phoneme called שְׁוָא. By "phoneme" I mean a distinctive speech sound, i.e. an abstract unit taken from the sounds of a language that corresponds to a set of sounds that are perceived as being similar.
שְׁוָא is a cover symbol for two sounds, which occur in specific environments, i.e. they are in complementary distribution, which means each of the two sounds will appear where the other cannot, and vice versa. Thus, you cannot substitute one for the other, i.e. there is no free variation.
Now, what are the two allophones of this phoneme? One is actually no sound at all while the other is an extremely short murmured vowel. Here is how they are distributed:
1. If there is a non-spirantized bgdkpt letter after the שְׁוָא and a short vowel before the שְׁוָא, then the שְׁוָא represents a non-vowel, i.e. a complete absence of a vowel. For example, מַלְכִּי /malkîy/ 'my king'. I made the "y" small to emphasize that it's just a mater lectionis and has no bearing on the pronunciation.
/malkîy/ <- /malak +i + ya/
As can be seen, historically there was no vowel after /l/.
2. If there is a spirantized begadkepat letter after the שְׁוָא and a short vowel before it, the שְׁוָא was historically a short vowel. Although the vowel is now lost and the שְׁוָא thus represents a non-vowel, the spirantization of the begadkepat letter is a trace of the historical full vowel that dropped out. I say "full vowel" to distinguish it from the three hatef-vowels, which are half-vowels.
For example, מַלְכֵי־ /malḵêy/ 'kings (construct)'.
/malḵêy/ <- /malak + ay/
In this case the historical short vowel was /a/.
3. If there is a spirantized begadkepat letter after the שְׁוָא and a long vowel before it, once again the שְׁוָא was historically a short vowel. Once more, although the vowel is now lost and the שְׁוָא thus represents a non-vowel, the spirantization of the begadkepat letter is a trace of the historical full vowel that dropped out. However, if the loss of the historical short vowel resulted in a two-consonant cluster that was not preceded by a vowel, the שְׁוָא that took the place of the historical short vowel was probably pronounced as a very brief murmured vowel. Thus, יִכְתְּבוּ was probably pronounced not /yiḵtḇū/ but /yiḵtəḇūw/ <- /yaktubū/. By contrast, מָלְכוּ was probably pronounced not /māləḵūw/ but /mālḵūw/ <- /malakū/.
This leaves us with the question of why the first ת in לִשְׁתּוֹת is not spirantized. As indicated above, a two-consonant cluster not preceded by a vowel is not permitted, which means the שְׁוָא on the first letter of שְׁתוֹת must have been pronounced as a very brief murmured vowel. The question is: why did the first ת lose it spirantization? If anyone knows the answer, I'm all ears!