In general this sort of attack should be very rare, as - since last March - invasion goes for the lowest influence faction rather than the nearest.When the invasion (from Oduduni) started, we dropped by 22% to match 26% of the "invaders" and we've been put at war as we were the only one non-native faction available for that (the others were already at war), risking to lose the system and our main station.
We won the war, we are now at 30% (so we lost 18% ballpark in 4 days) with the invader at 22% and still present as 8th faction in the system.
Even if we did win the war, we've lost a lot of influence (risk/reward profile says we've been exposed to tremendous downside risk without any kind of reward)... moreover the invader is still in our system.
So for a direct attack on a system controller, either the controller has to already be in trouble and therefore on very low influence, or every other potential target must be in a conflict, and of course there can't be any systems with <7 factions in either.
It's not completely impossible, of course - and more likely out on the fringes - but you did get really unlucky.
Additionally, changes in 3.6 to make Retreats easier may mean that invasions themselves start to become less common again over the next few months.
(And yeah, they'll be gone in a couple of hours - congratulations on beating them - but may be back again soon if they're that short on targets: it may be worth watching their expansion states and making sure one of your other non-native factions is conflict-free at the crucial times)