Tube-based X-ray sources generate X-rays by accelerating electrons towards a metal target. When the electrons collide with the target, they decelerate rapidly, producing X-rays. Synchrotron sources, on the other hand, create X-rays by accelerating electrons to nearly the speed of light and then bending their paths using powerful magnets. This produces a broad spectrum of X-rays.