Symptoms of epilepsy?

My friend had an epileptic attack today in the middle of an exam she just suddenly collapsed, started shaking, being sick she was moaning as well to at the end and when she got up she felt really dazed. can someone explain this to me and how and why this happened how is it triggered
thanks xx