On April 2002, designer Gus Smedstad provided a detailed explanation of the skill system on the Round Table forums.
"The primary thing that determines a hero's skill choices is his present class. For example, if he's a priest, he'll be offered Life Magic and its secondary skills. If he's a ranger, he'll be offered Combat and Scouting skills.
The first two skill choices, when possible, are improvements to existing skill families, rather than a new primary skill. If possible, they will for different families, and only for families that match the hero's class.
Your hero will be offered Combat skill a minimum of once every 3 levels until he reaches Grandmaster. This is because Combat is vital for all heroes to survive later combats. Other Combat skills such as Melee are not offered this often unless your hero is an appropriate class.
If your hero has 6 or more skill levels for each primary skill he knows, he will be offered a new primary skill. For example, if your hero has 5 levels in Combat related skills, and 7 levels in Death related skills, he will be offered a new primary skill.
The chances of getting a particular primary skill depend on the hero's current class. Skills that are particularly appropriate, i.e. Nobility for Paladins, are more common.
Classes that are associated with a particular alignment (i.e. Knight, Paladin, Priest) are never offered magic that opposes that alignment, unless the hero has at least Basic skill in that magic.
Barbarians are never of offered magic as a new primary skill. They must advance to another class before they will learn magic.
If your hero isn't offered a new primary skill, he will be offered an improvement in an existing skill family as his 3rd choice, if possible. Occasionally this is not possible, such as in the case of a Priest's increase from 1st to 2nd level.
The new choice will be in a different family from the first 2 choices, if possible. The 3rd choice does not have to match the primary skills of the hero's current class.
If your hero cannot advance further in his existing skills, it's possible to be offered 2 or even 3 primary skills.
All this is fairly complex, so don't be surprised if the results aren't precisely what you predict."