Block randomisation
How do the groups keep equal numbers throughout? In block randomisation, assignment is made in small blocks, for example 4 persons. Each block holds each group equally often, with the order inside drawn at random.
Example: Block of length 4, two groups: there are 6 possible orders with 2 A and 2 B each, and one is drawn.
Caution: With a fixed small block, the last place in a block can become guessable. Varying block lengths and blinding help.