Tighten the chain. Do that first.
Yes, it’s almost always because the chain tension is too low. A chainsaw chain should be snug against the bottom of the bar rail — no sag, but still able to spin freely by hand.
If you’ve been tensioning it and it still flies off, check the bar rails for wear. A burred or pinched rail can let the chain wander. Also look at the drive sprocket at the tip — if that’s worn down, the chain has room to jump.
Most people just need to loosen the bar nuts,