Superstitions are born of the same human traits that eventually gave rise to scientific thinking/processes: Curiosity, a desire to understand the why of things, events. Even today people sometimes confuse correlation with causation; two things occur with short time gap and the earlier one gets labeled the cause even tho a third as yet undetected force or process may actually cause both.
Some actually make sense, like not walking under a ladder---at least you shouldn't without looking up to see who and what is up there--you could bump it, topple it and end up with an injured workman on the ground and a can of paint all over you. Or worse some heavy or pointed tool could strike you.