It has to do with the amount of fouls in that period. Before the bonus you only get free throws if in the act of shooting when fouled. After several fouls (7 I think) you are "in the bonus" and you get free throws for any foul.
Edit: It is less if it's a game of 4 quarters (Pro) rather than by half (College)
TX, I'm pretty sure it is 5 team fouls.....
