Indexing is both an art and a science. It requires meticulous attention to detail, an ability to understand and make links between different concepts, and judgement about what to include and what to leave out.
A good indexer needs to see and understand what the author wants to get across and stand in the place of the reader. The index needs to meet the needs of the person who has never read the book and the person who has read it and wants to return to a particular passage or topic. In both cases the index entry needs to take the user to a useful point.
The skills needed to be an indexer are developed through training (such as that provided by The Society of Indexers) and with experience.