Wild how that works... I've had stuff like that happen with other things. Like dropping my keys made me finally put up a hook by the door. Or my phone charger yanking out of the wall got me to tape the cord down. It's like a small mess forces you to fix a bigger, lazy habit you were ignoring. Kind of a happy accident.
Oh wow, I read something about this once! It said our brains notice problems better after a small shock or mess. That totally fits with your coffee spill making you check for leaks. It just kicks you out of your normal routine so you see what you were missing.