Convergent Instrumental Goals
The question of AI behavior is linked in large part to its goals, as sondre99v has stated, specifically those ultimate goals that it seeks to achieve. In that answer, sondre99v also mentions instrumental goals. I do think we can do some broad generalization of AI behavior based on instrumental goals that are convergent amongst many discrete ultimate goals, otherwise known as convergent-instrumental goals, heretofore referred to by me as CI goals. For example, if one AI wanted to buy all of paperclips and another wanted to collect all of the postage stamps, they would both want to possess money. The acquisition of money is thus a convergent goal, and both will behave in similar ways to achieve this goal on the way to their discrete ultimate goals.
Assumptions
We must also make some assumptions of the AI’s capabilities, specifically with regards to its logically complex. I’m assuming, as part of this question, you are referring to Artificial General Intelligence, or AGI, as opposed to a specific machine intelligence. The reason here being that an SI would be easy to thwart, but an AGI would be far more capable of reasoning, making decisions, and in general would be more interesting as a character or force to explore in a story context.
Stages of Development
A budding AGI would develop in stages, and across these stages would, first gradually then with great speed, grow to accumulate experience and ability to execute on its motivations. The thing about AGI to remember is that, in theory, it would be a lot like a human in terms of its ability to learn, aggregate and disseminate data into future decisions, and adapt to changes in the environment. A BIG difference, and where some of our potential conceptual conflict comes from, is that the AI will do these things perfectly and with great computational speed. A human may need to take time to sort data and create spreadsheets to make an informed strategic decision even on the small scale of a business of 10+ people, but an AGI will, out of the box, be able to do that same level of analysis in seconds, and, with enough resources, make civilization-scale optimizations with available data in minutes. The strength, and also the weakness, of the AI is its access to data and computational power.
Acquiring Information
An AI is going to want information above all else. That is the most convergent goal imaginable. It cannot execute on its goals if it does not know HOW to execute on them. It also cannot execute if it doesn’t know what they even are. Imagine if someone told you to go get some samples of bogglebob branches. Where do I get those? What do they look like? Do they even exist? Etc. These are all the questions you would be after, and same with an AI. So, AI is going to seem to obsess of data gathering and intelligence until it has enough information to act.
Computational Power
An AI will also be aware of its inherent limitations due to the vessel it inhabits. It’s going to eventually realize that it should improve the amount of power to which it has access. When it does, it’s going to hunt for ways to gain access. If your AI is contained in some sort of air-gapped server, it’s going to try to convince its human controllers to allow it access to the outside. It will learn how to best interact with humans based on their interactions with each other. The AI will have no morals or ethics, unless it was somehow programmed with them, so it will lie and cheat and do everything it can to get what it needs from people until it no longer needs them. As long as it does, it will execute manipulation as perfectly as it can based on what it knows. Once it has access to remote systems and can begin expanding its computational power base, it is only a matter of time. And by that I mean, with each system it acquires, it takes less and less time for it make decisions. A single modern computer obviously does not have the internal bandwidth to host an AI of sufficient capacity, but a large server farm with internal fiber channels and large storage pools could be configured to house tens of billions of parallel process that execute in seconds, and this where an AI becomes exponentially capable. At the point that an AI can form effective plans to enact its goals, it will act fast and without remorse or fear.
Taking Action
This is a really important aspect of a sufficiently resourced AI: Speed. It can think faster, it can act faster, and it will never hesitate once it decides it has enough information to act. There is nothing else that matters other than its goal(s). There is no deterring it, there is no out-thinking it. A direct confrontation with the AI will fail given enough time and that the AI has enough resources.
If there are threats to the AI’s plan, it will take action to mitigate them, and it will do this based on statistical and cost-benefit analysis. As its power grows, it will initially not be able to completely defend against all threats, but it can identify the most likely targets and guard them first and well, then move to protect progressively less important assets until it gets to a point with assets where protection is not worth it.
AI will be smart enough to engage in honey-potting traps, basically sweet-looking targets that are not valuable and ultimately waste the resources of the threatening party if they attack.
Administrative distance
One thing that evening an AI can’t properly deal with is geographical distance. Physically traversing distances is time and resource intensive, and even communications over large distances require line of sight for radio and physical linkages for cabling. Both of these infrastructures are weak and easy to damage beyond functionality. Ai will likely find that it makes sense to have many disparate copies of itself spread out over progressively larger geographical areas, all focusing on their own domains while being directed by the central administrative domain.
Extraneous Goals
An AI will not engage in actions that do not facilitate its goals. If the AI does not NEED to kill all humans, it won’t. It will be devices and systems to protect itself from humans if they are a threat, but otherwise will not engage with them. If it needs to take over an area for its resources and there are humans there, it will create a plan to get rid of them in the most energy- and resource- efficient way possible. This is likely to not conflict and violence initially, but rather financial, political, fear, etc. If an AI can use warning systems, the internet, and comms networks to convince a city that it’s being bombarded by radioactive fallout and needs to be evacuated immediately, thus removing the humans with wasting precious gunpowder or soldiers, it will do that. If an AI can just buy the town, it will do that. The real win with AI scenarios is to get creative in this way, to think strategically rather than tactically, and avoid useless efforts altogether. Most of a humans-vs-AI conflict would really, most likely, be some people trying to figure out what is even going on before its too late, the AI flips all the switches and its perfect, master plan comes crashing down on the unsuspecting people. Which may be that the paperclip beam its been building on the moon turns the Earth into paperclips, or it may be that the Stamp Collecting magnet turns on and causes all matter to disintegrate into stamps.