On smartphones, in addition to sensors to receive images, we also have a lens system. Saying 'glass' is probably not true, because most of them are made from plastic to reduce costs. But plastic is very flexible and easy to scratch, so people often add a hard glass layer to protect it.
In recent years, some manufacturers have also experimented with 'sapphire glass', advertised as nearly as hard as diamond. In nature sapphire is a gemstone made of aluminum oxide (α-Al₂O₃), which is essentially transparent but because of impurities it is often colored. The first artificial sapphire glass was created in 1902, by heating aluminum oxide to 3,600 ° F then squeezing it into a thin sheet. Simply put, sapphire is 'transparent aluminum'!
The process of creating sapphire is very expensive, so of course, sapphire is not cheap, but it is not too expensive to cut a small plate to protect the smartphone camera lens. According to the experiment of many YouTuber, sapphire glass used on some smartphones (including iPhone) is very thin type, so it can be scratched at Mohs 6, while high quality sapphire is new to scratch .
We also have another material that is harder: diamond, so can we use it to protect the glass? In fact, there are a few companies that produce diamond lens elements to apply to laser applications, whereas it is very expensive to use on smartphones. But this is not impossible, maybe someday Apple will launch a super special iPhone version that is limited, using diamond for its camera lens!