You can google for more of this interview:
To simulate a plate appearance, we break it down into steps where if one result is achieved we advance to a different step than if another result is found; like a "choose your own adventure". Assuming a normal game situation with no one on base, we look at the batter's walks per PA and the pitcher's walks per batter faced to determine the likelihood of a walk. A random number is drawn. If it is within the constraints of the probability, a walk occurs. We do the same with hit by pitch.
If neither occurs, we move on to whether there is a hit or an out. Ballpark factors, lefty vs. righty splits and specific weighting from extreme hitters and pitchers comes in to play here, but essentially this is the hitter's batting average compared to the pitcher's average allowed.