Your chain is probably too loose.
Yes, loose chain tension is the most common cause of derailing.
Chains stretch with use, and if you don’t tension it before each session, it’ll jump off the bar at the first tight spot. The fix: loosen the bar nuts, turn the tensioner screw until the chain just touches the bottom of the bar rail, and you can pull it away from the bar with a gloved finger — about 1/16th inch gap. Then retighten.
If that’s not the problem, look at the bar rails. Worn, burred, or uneven rails let the chain wander. Run a file across the rails to knock down any raised edges, and if they’re cupped or too wide, replace the bar. Also check the sprocket tip — if it’s worn or the bearings are shot, that’ll throw the chain too.
One more thing: make sure you’re using the right chain pitch and gauge for your bar. Mixing sizes is a recipe for derailing.
Don’t run it too tight either — over-tightening kills the bar and chain.