The eye is filled with a jelly-like substance known as the vitreous. This jelly is loosely attached to the retina at the back of the eye.
As we get older, the jelly tends to shrink a little, and can tug on the retina. In some cases the vitreous can detach from the retina.
As it tugs on the retina, this can cause flashing lights in the corner of your eye followed by the appearance of floaters which move across your vision.