If you are a computer science major interviewing for a computer position, then they will not ask you this question. But if you are an English Literature major and interview for a computer position, then they might want to know why you chose to major in English Literature. To create an answer for English Literature, you can say things learning to be a better communicator, having better reading comprehension, and say how skills learned from English Literature can be applied towards many fields. But something like History is different. Unless you are going to be a Historian, it's hard to justify how your major is going to help you in your job.
It doesn't connect the major to the job but at least it gives an explanation. It's not bad to say you majored in something because you liked the subject. The only bad answer is to say you didn't know what else to do and you couldn't get into a better department.