Definitions by Colouring
Loli
Loli came from 'Lolicon', which also originated from the 'Lolita Complex'. In terms of Japanese culture, 'Lolita' was taken from Nabokov's novel but instead stems from the positive idealization and romanticization of girls' culture developed during the Meiji period. 'Complex' derives from 'romantic love for something'. So, that's how it came into existence. It was shortened to 'lolicon', as the Japanese refer to having a complex of loving physically young-looking girls. With time, it evolved into the word 'Loli'.
Shota
Shota came from 'Shotacon', which also originated from the 'Shōtarō Complex'. 'Shōtarō' means 'masculine young man', and 'complex' derives from 'romantic love for something'. So, that's how it came into existence. It was shortened to 'Shotacon', as the Japanese refer to having a complex of loving physically young-looking boys. With time, it evolved into the word 'Shota'