Not really enough information about your build but a place to start would be to check out the mechanical side first.
Is the gantry running true ? If it`s out of square then it will bind and stall the stepper. ( Disengage the motor(s) and move by hand to see if there are any tight spots )
Is there contamination in the rack & pinion ( If you have them ) This will cause binding and loss of steps.
If all checks out ok then start looking at your programme. Does it lose steps in all axis ? Are you feeding too fast and the machine is trying to change direction too quickly ?
There are so many factors to consider as to the reasons for loss of steps it is all but impossible to tell you with any accuracy what the rout cause might be.
Good luck.