Why did birds develop wings?

birds probably didn't develop wings. its thought they evolved from winged reptiles so it was reptiles that first developed wings.