It depends on what is considered mind and stupidity. If we take the IQ as a measure, then this is the interaction of genetic factors, the social situation of development: education, social environment, ecology, nutrition.
If a person is constantly doing something, he begins to do it better. This also applies to thinking.
Those who try to understand something on their own, get to the bottom of things, in the end, have a more developed thinking. Those who, from childhood, have been taught to always take their word for it, believe in authorities and "do not go with stupid questions" have undeveloped thinking.
Those who are surrounded by smart (good reasoning) people often become smarter themselves as they feel that intelligence in this environment is appreciated. In other environments, the person may not have the incentive to train the mind. Moreover, in some circles, the manifestation of the mind is condemned.
Among people who only try to appear smart, the idea is widespread that you need to hide your ignorance of something. They believe that if you show ignorance, you will be appreciated less. Such an environment does not contribute to the development of the mind, because it closes one of the most fruitful opportunities for the development of the mind - learning from a smarter / knowledgeable person.
Among people who are really smart, it is encouraged to ask each other questions (that is, , openly show their ignorance). Because if you ask a question, then you want to learn something. Usually, smart people like to share knowledge, willingly answer questions. This environment promotes a fuller, more qualitative understanding. Frequent discussions and clarifications help train the mind.