Exactly how this is done varies from program to program and is beyond the scope of this document anyway - but see the papers written by Michael Buro to which there is a link at the bottom of this page. In the process of determining the relative values of the different configurations, one must decide what the evaluation function should try to predict. This approach is used by Logistello, Zebra and Keyano. Winning probability Used by Turtle and Brutus. I believe that Hannibal uses a weighted disk difference measure where the winning side gets a bonus corresponding to a number of disks.
All strong programs use opening books and update their books automatically after each game.
Most of the top programs have opening books which to some extent are based on IOS games, so the books have a large overlap. What differs is how the information from the games is used. As the number of moves available to each player decreases towards the end of the game, the programs can search much deeper in the endgame phase of the game. This is usually with 24-30 moves left for the top programs. Good endgame performance is all about move ordering, and it pays off to use move ordering heuristics different from those used in the midgame.