From: Ol' Blighty
AI will declare war when it has -relations in the diplomacy screen and when it is more powerful than its target. Or when you do something really harsh to it first, but then thats not really the AI attacking, but responding to an attack.
If you are not seeing wars I'm guessing its because all the factionsa are of about equal power, or the friendly nations less likely to declare war are more powerful than the nasty ones (which is common, especially if the nasty ones have the rubbish government types like Despotism or Military Dictatorship).
Saying all this, I see AI vs AI wars every single game, often from near the beggining, but yes attacks on me are much rarer, though they have happened. Usually I find myself more competing with a nation than outright fighting it in war. I give weapon and shield techs to their enemies, I take independent planets in their backgarden etc, try and keep my military strength as good as theirs (which in turn makes them less likely to attack).
"My body may be confined to this chair, but my mind is free to explore the universe" - Stephen Hawking