What Makes Good Data for Alignment? A Comprehensive Study of Automatic Data Selection in Instruction Tuning