This is a description of the assimilation of laam to the following “sun letter”. It is a description purely in terms of Arabic orthography, not of scientific phonology and phonotactics. In the word الشمس “the sun”, the laam has no diacritic and is not pronounced as /l/, while the following shiin is written (in vocalised script) with tashdiid, indicating that it is geminated. The word is thus pronounced as ash-shams.
The gemination of the “sun letters” is a feature in all stages of written Arabic, and also of the modern dialects, but it does not have a totally predictable phonological rationale. For example, in most dialects the historic jiim is a dental /dƷ/, but is nonetheless treated as a “moon” letter, while in Egypt it is /g/, but it is a “sun” letter. This has a historic reason.