Undulators are a type of insertion device - an array of magnets inserted into the path of the beam which caused a change in the path. The magnets exert a magnetic field which causes the electron beam to "wiggle" as it passes through. In fact there is a special type of insertion device called a wiggler!
The wiggling path causes the beam to create electromagnetic waves in the form of light. The light from each successive wiggle adds up to produce a very intense beam of light in the forward direction, which is channeled into the beamlines to be used in experiments.
Because the electrons are travelling at close to the speed of light, relativity and the Doppler effect mean that the wavelength of this light is very short - it is in the form of X-rays.