Why does this happen?

When the brain is injured it tries to repair itself.  Unlike other parts of the body, the brain cannot make new nerve cells for repair.  Instead, the nerve cells that survive the injury try to compensate for the lost cells and make new connections in the brain.  These connections appear to be susceptible to developing seizures much more readily than the original circuits and people can begin to develop spontaneous seizures (epilepsy).  At the present time, there is no known way to block this process, but there is considerable research being done by many investigators.