People tend to lose their feet on flats for 2 reasons.
If your feet come of the side of the pedals chances are you've let your legs become straight (knees locked), If your feet slip off the back you need to move your foot forward on the pedal … this is very common when people move from clips to flats. When clipped in the ball of your foot will be pretty much over the pedal axle, on flats that position is quite unstable when you're riding technical stuff, so push move your foot further forward … somewhere around an inch should do the trick.
There is a 3rd reason which involves cr*p pedals and poor shoe choice 😉
Cheers
Stuart