In addition-
They are often used to create a gear reduction ratio that would be impossible or impractical without. For example, a 10:1 ratio can be reached with a 10T engine sprocket and a 100T axle sprocket. But that axle sprocket would be huge! The tire wouldn't touch the ground because of it. So- jackshaft. 10T on the engine and 20T on the "in" side of the jackshaft. Then a 10T on the "out" side of the jackshaft to a 50T on the axle. Same overall ratio, axle sprocket is half the size.
Jackshafts can also be used to go from belt to chain drive or vise-versa.