What is a Loss Function? Understanding How AI Models Learn