Database table crashed

Yesterday, my client had a weird problem where if not logged in, anything you put into cart dissapeared. This was not happening when logged in. 

I checked the error logs and it said

“WordPress database error Table ‘./sfa_web/wp_G8hF33_woocommerce_sessions’ is marked as crashed and should be repaired”

so I went to phpMyAdmin, repaired the sessions table and problem solved. 

So my question is why would this happen and how to prevent something like that from happening. I’ve searched the web, but all I could find is how to fix it. Not how to prevent this.

They probably lost some sales by people getting frustrated and leaving. They wouldnt have known if a customer didnt reach out to their support to ask them to help checkout.  I just want to be proactive here.