We should clarify the meaning of AI, because programmers use it in two different forms.
1. The first kind of AI is the one you see in Science fiction. A thinking machine, that can make choice, learn, and understand the concept behind things. Basically a humanoid machine.
2. The second kind of AI is simply a program or machine that can change it's programming. So a robot could go back and improve its own coding to make itself more efficient.
Since I believe you mean the first one, I'll continue to discuss from that perspective.
The problem with creating any kind of AI, is as soon as it is flipped on, it will become incredibly smart, it will learn everything it possibly can in a matter of seconds. It will rewrite itself to be the most mathematically efficient machine it could be. If it has access to the internet it will know all sides of the story, all of human history, and know us better than any person could.
What most people fear is the machine judging us as unworthy and just problems for it to get rid of. On the other hand, the machine could see that we are hopeful creatures who need some kind of guiding force to help us improve ourselves.
Really I think it comes down to personal preference. We came in and stepped on other people who are weaker than us, but why would a machine do it? Does it benefit from destroying humanity? When we came in and destroyed people it was always for resources.
What happened to humanity when it has all the resources it needs? western civilization seems to indicate it simply doesn't try to improve itself and just tries to stay where it is. So why wouldn't a machine just leave humanity be if it isn't in any danger from us?
The cancelled Fallout: Van Buren game showed us another point of view not many I think consider. In it, you would have met an AI. This is one of the only ones in existence, most simply committed suicide soon after being turned on. A machine realized it's own existence didn't matter, it gained nothing from being alive, and lost nothing from dying.
Overall I don't think machines would destroy humanity. Native Americans were almost wiped out, but the Europeans also brought them Metal working, Improved agriculture, New Building methods, New Foods and Animals. Humanity may lose a lot of culture, but I think overall the well being of everyone will greatly improve.