Stupidity is the quality of being stupid. It’s the opposite of intelligence. Stupidity is responsible for many acts that follow the words, “Hey, watch this!”
Being stupid has to do with not understanding things, not learning from past experiences, and generally not using your brain, so stupidity refers to this quality. Saying that someone did something because of stupidity is an insult because it means the person really should’ve known better. Riding in a shopping cart tied to the back of a car and zinging around a parking lot would be the result of some serious stupidity.