So one of my planets got invaded, out of the blue, by the Drengin the other day.
What?, I said. I'm not at war with the Drengin! And the United Planets passed that "Neutral Territory/One week Warning" law anyway! What gives?.
Fortunately, my 8000 elite soldiers fought off the invading army, allowing me to take a look at the planet that had been invaded -- it was a formerly Drengin world that had culture-flipped to me, but which I did not have the right colonization techs to actually use. So it sat there, empty of everything but colonists, while I did other things. I even forgot to defend it at all (since I couldn't build a ship there, I would have had to send one over from elsewhere, of course).
But what of the invasion? After it was over, I checked, and, nope, I wasn't at war with anybody. In fact, the Drengin actually liked me, probably because I was the only one in the galaxy who was trading with them. So I hurried a ship over to the planet from elsewhere, and it has remained uninvaded since then.
But, you know, that has to be considered a bug. Just because a planet doesn't have any ships in orbit around it shouldn't mean that you can send in the troop transports without declaring war. Right? The game wouldn't let me send troop transports to invade an undefended Thalian planet without declaring war, would it?