To flesh out admarlow's answer:
For most people, floaters occur as they grow older. The vitreous humor thickens and clumps as we age, and floaters result from the clumped vitreous gel. Sometimes pregnant women see spots caused by little bits of protein trapped within the eye. Eye injury or breakdown of the vitreous humor may also cause spots and floaters.
When people reach middle age, the vitreous gel may start to thicken or shrink, forming clumps or strands inside the eye. The vitreous gel pulls away from the back wall of the eye, causing a posterior vitreous detachment. It is a common cause of floaters in people who are nearsighted, have experienced cataract surgery, or have had a severe inflammation of the eye.
As previously mentioned, they can also occur due to embryonic cells continuing to grow as we age, finally reaching a size that they or associated shadows can actually be sensed.
(Thanks to All About Vision)