The AI tries to win. But it is not very clever, so it have to cheat. On the other hand, if it were cheating too much, it would be too much difficult. It is a matter a balance for the AI being competitive and not too rough/silly. By the way, it is all the point of difficulty levels. Just try a more competitive difficulty level, you will not say that you are bored anymore.
On the other hand, the AI is not here to attack endlessly. It is here to look like a real civilization. Nations does not go to war all the time, this is false. In reality, nations can't "win". The fact that the AI civs don't attack all the time is really a necessity to show the player that he is in a real world. If peace was not existing, there would not be realistic interactions like peace treaties and so on. War is not the only pleasure in Civ. Simple management is one of the pleasure also. No need to go to war to win anyway. That's not because the AI civs are not warmongers that they don't tend to win. The fact is that when an AI win, you're not here to see it anymore. Each time you loose means an AI win.
The fact is that you may feel that the AI does not use all the tricks in order to win. For example, it does not rush you. It does not rush big armies when it sees that it can't grow anymore to conquer your cities. That's precisely what would make the game unrealistic: civilizations are entities that not tend systematically to war. They are peacefull entities that look for prosperity. But after all, maybe this is not true. Maybe that for long periods, like those in Civ (a turn being several years), civilizations are truly agressive. Maybe nations naturally tend to war and agressivity, conquest and glory. In that case, it would be wise that peace situations would just be strategic decisions. But it is really? What is the normal state of civilizations, peace or war? Dispite all wars and the conquests temptations, I think it is peace. Civilizations tend to peace. After all, isn't war for peace? When the world will be one nation only, war could not be considered anymore. War is just a result of all civilizations and culture differencies, civilizations identities. Still, different civilizations can live together in peace.
Now, there have to be a goal in Civ as in every game. So the player will simulate the behavior of an agressive and successfull civilization in order to win. The shame would be if he can't act in another way in order to win. But would win culturally not mean being agressive anyway, even if it's not by the weapons? Build x building here, x there, letting no chance to the neighbour to breathe, and conquering one city after the other if this is possible. Can the player win not being agressive? It would be a nonsense, as every game needs to be played and challenged. But what is agressivity? Here it is the fact to obtain something for oneself at the depends of another self. But what if we don't act for our civilization anymore but act as a part of God, modifying some elements in order to modify some ways? What if we don't act directly for ourselves, but inside the machinery that decides if our civilization extends naturally? If our culture spreads? How did the Gauls take form? IMO, it would be more wise that the player can have a part of influence on the civilization formation than having systematically fight for victory. Of course, the civilizations formation would have to be simulated.