The Photophysics behind Photovoltaics and Photonics