There is no easy way to answer this as no one knows the answer for sure. There are numerous theories on this issue.
One major theory over the years has held that it is culture that makes some nations successful while others fail. Max Weber, for example, pointed to a "Protestant work ethic" that he said made Protestant countries like Britain and the US more successful than Catholic ones like Spain. Others have identified other cultural characteristics. In general, these theories say that some countries simply have cultural systems that are more oriented towards growth and success than others.
Other theorists point to different things. Jared Diamond, for example, talks about the impact of geography. He says that Eurasian countries came to dominate the world because of the fact that geography allowed them to get agriculture first. Niall Ferguson identifies six major factors that, he says, allowed the West to dominate the world. They were political and economic competition, the scientific revolution, democracy, medicine, consumerism, and the Protestant work ethic.
Different scholars can and do have very different takes on this issue. Overall, we cannot know for sure what factors lead countries to become powerful or to remain weak.