it accelerates particles, usually electrons, protons or neutrons. While the final speed (they will reach near speed of light anyway) is not the relevant features, their energy is.
Those particles are then used for high-energy collisions with other particles or targets. This is rather violent and rips their internal structure apart. Then those fragments are studied, they give a short glimpse at how particles are built inside.