The mantra here is nothing magical. I have used it in the sense that it should be the first and most important basis for your selection. The optional subject in itself is very important. Compared to other five papers in civil services exam, it is this subject that you can master. As far as the four papers for essays and general knowledge are concerned, the syllabus is not limited. The preparation is also subjective, every student prepares in a manner he sees fit. However, your optional paper is one that you have chosen. Its syllabus is clearly defined and it is taught in a systematic way in colleges. You have been studying it since long. But general knowledge has not been taught to you like this. This is why you can see a huge difference between scores in general knowledge while there is not much discrepancy (leaving aside any exception) in optional papers' scores. This is why you should do the best preparation you can for your optional paper. You should try that your score is in the higher range. This would be quite difficult if you do not choose your paper wisely.
I will now tell you the most important scientific principle behind how to choose your optional subject. This method is time-consuming but you will reap benefits. So let us talk about the most important aspect of choosing your subject.
After talking to various people -and after giving it a deep thought- if you have decided on one particular subject, let mecongratulate you. However, if you could not settle down on one subject, or you are confused among two three subjects then you can use the following method-