In the UK, numbers of winning Premium Bonds (which were not strictly a lottery, but very similar in approach) were generated by an electronic machine called ERNIE.
A gravity pick machine has a chamber with rotating paddles inside, spinning in opposite directions.
As the mixing paddle slows down, the ball lands on a pedestal, where it is carried to the top of the machine and then pushed onto the tray.
Some lotteries use computerized random number generators, either alongside or in place of a mechanical draw machine.
In some cases there are several machines and several sets of balls, and the combination to be used is selected at random just before the draw.