NASM-CPT, USATF Certified Running Coach, and Director of Education for STRIDE Fitness, national fitness brand offering treadmill-based interval workouts
If you think about what the glutes do, it is hip extension. Running uphill allows for greater extension. When your knees come up further to climb the higher elevation, you're working through a greater range of motion, and your glutes have to work harder against gravity to push you up the incline. Hill work is strength training for runners.