The Connection Between Active Galactic Nuclei and Their Environments