There's various ways to approach this with AI. I don't know about this exact example, but in general the specific game rules would not need to be programmed into the software. A more advanced system would have a goal such as maximizing the score. The program would need to have access to the state of the machine, such as knowing what switches are triggered and/or what lights are lit, and how much and when the score is increased. The more it plays, the more it would learn how to navigate a path through different states of the machine to maximize score. In such a system, it naturally learns the "rules" or at least how to maximize its score which is an approximation of learning the rules. Any particular state is given a desirability value (or score, not to be confused with pinball scoring). The program learns how to navigate a path of states to maximize scoring. Some variability or randomness is added into the system, so different tactics (flip timing or angle) are tried and evaluated from each state. Rather than pinball rules, more primitive knowledge could be pre-programmed, such as the drain switch being given a large negative score.
Anyway, that's a kind of general approach that can be used with many types of games, such as chess.
A program might learn to make an easy shot with high degree of accuracy, and just repeat it continually as well, which would be pretty boring. But such scenarios can be avoided by attributing a higher value to achieve higher scoring per time period.