Advancements in the Understanding of Nonlinear Optics and Their Use in Material Analysis