Most of the current Italian pronunciation is retained from Ecclesiastical Latin, such as ce/ci, ge/gi, gn.
There's one sound, gli, that I can't find the origin of. Many words containing gli that, dating back to Latin, was le/li or lle/lli (e.g. illi → gli, melius → meglio).
This sound is also present in some other Romance languages, like French ille, Spanish ll and Portuguese lh, but not Romanian (no such sound).
I'm guessing this sound was imported from other language families (Germanic / Slavic) some time around the collapse of the (Western) Roman Empire?