The Connection between solar magnetic fields and photospheric dynamics