The evaluation function of a chess programs returns a score for a given chess position in a static way. By "static" I mean it won't have into account, e. g., whether the queen is attacked, or if a checkmate is about to happen (that part is done within the search function of the program).
Most eval functions are based on the value of a single pawn. If you take a look at Seconchess' source code you'll find stuff like this:
#define VALUE_PAWN 100
#define VALUE_KNIGHT 310
#define VALUE_BISHOP 320
#define VALUE_ROOK 500
#define VALUE_QUEEN 900
So for a given position, the eval function counts how many pawns, knights, etc. there are on one side (black or white) and it just sums them up. Then it makes the same for the other side and the final score is the difference between white and black scores.
Secondchess is a very simple chess engine, and so is its eval function. It only takes into account the material on the board and adds an extra bonus/malus for the position of each piece on the board. For example, a knight in d4 has a bonus of +15, and a knight in h1 has a "malus" of -40. (This info is stored in the array pst_knight[64]
).
As you can imagine, serious chess engines have hundreds (thousands?) of these values; for doubled pawns, for rooks on open columns, pieces mobility, king safety... And it also take into account the phase of the game; opening, middle game, endgame. And yes, tuning these values is such an important and difficult task. Some techniques exist for optimising these values, being CLOP one of them.
About the question "How does it go from the weights to actually deciding what move it should make?". Ok, from the weights, you get the score of a single position, and using a search method (usually alpha-beta is the way to go) you find out the best move from a certain position.
See also
This is another simple chess program for beginners; Tom's Simple Chess Program. But take into account this one is not free software. In GitHub you can find many chess engines in several languages.
Finally, as far as I know, the place to go for chess programming questions is http://talkchess.com.