I believe what you are experiencing is the stepper motors getting offset during the print, usually due to the nozzle colliding into the model (but possibly also due to very high printing speeds).
Basically, the stepper motors used in most 3D printers will always make moves relative to their current position (as opposed to absolute positioning). In other words, the stepper will for example be told to move 10 steps left, regardless of where it is currently at. If you therefore forcefully move the printhead out of position during the print, the electronics will never know it happened, and continue with instructions that are no longer viable.
In order to fix this, do what you can to avoid the nozzle colliding into the model:
- Make sure your printer does not leave large deposits of filament, typically due to over extrusion or too close Z-leveling of the first layer.
- Make sure the model sticks to the bed, so that warped parts don't lift up, obstructing the toolpaths.
- Add Z-lift in your slicer software, so that the printhead lifts slightly between travel moves.
- Reduce travel speed (if it is set very high): the strength of stepper motors is lower at higher speeds, which means nozzle collisions at higher speeds most likely will offset the motors.