How a particle accelerator works