Betting continues sequentially around the table until all active players have contributed an equal amount to the pot (or until there is only one active player remaining). The game then proceeds to the next round (as defined by the script). In the final round the remaining players enter the showdown.
Note that all players must be given at least one opportunity to act before betting is terminated (this allows for the case where all players have equally contributed $0). Being forced to put a blind bet in the pot does not count as having had an opportunity to act. Also, there often is a limit on the number of raises (increments to the contribution amount) which artificially forces an end to the betting.