Sometimes mechanical failures are the cause, but most times I find that things like many have described here are simply human error. Or possibly not taking time to do that last slow walk around, while checking all of things we are sure we did correctly. I grab every compartment door to assure myself that they are closed and latched securely. Grab the tow bar arms and look at the pins, etc. Just to make sure and yet there is always that one time when you miss something and when you look back you realize you were just plain dumb or in too big of a hurry to get going.
Like most things in life, it's not if you have ever done these things, it's usually a case of when are we going to do these foolish things. It's just life, hope for the best and deal with the rest.