Hard to tell without more details.
Ideally it would be useful to know what ships your opponent and you were using, but from your post I suspect you don't know the opponent's composition.
A few general questions that may help narrow it down a bit:
What faction were you playing?
What faction was the opponent playing?
How long had the game been going?
What was in your fleet?
Are you leaving abilities on your ships on autocast or are you casting them manually?
Of course it would be easiest to diagnose the issue if we knew what ships the AI fleet had, but the above questions should be easier to answer and might help us figure out what's going wrong.