It's the case of the "Outside Context Problem" as described by the late, great Iain M Banks [via
The usual example given to illustrate an Outside Context Problem was imagining you were a tribe on a largish, fertile island; you'd tamed the land, invented the wheel or writing or whatever, the neighbors were cooperative or enslaved but at any rate peaceful and you were busy raising temples to yourself with all the excess productive capacity you had, you were in a position of near-absolute power and control which your hallowed ancestors could hardly have dreamed of and the whole situation was just running along nicely like a canoe on wet grass... when suddenly this bristling lump of iron appears sailless and trailing steam in the bay and these guys carrying long funny-looking sticks come ashore and announce you've just been discovered, you're all subjects of the Emperor now, he's keen on presents called tax and these bright-eyed holy men would like a word with your priests.
Banks goes on to note that most civilisations tend to encounter an Outside Context Problem only once, at the point where that particular civilisation ends or is subsumed into the more powerful one. (Incidentally this is also the title of a series of eBooks by Christopher Nuttall which are satisfyingly geeky.)
Of course, there are plenty of fictional examples of invasion, I guess ranging from the barely-competent aliens in Niven & Pournelle's "Footfall" (who were easily detected) and the almost-Gods of Arthur C Clarke's "Childhood's End" who basically just turned up without warning. It's too varied a field to come up with an idea of how we could detect them.