There are different types of retinal detachments and thus different causes. However, in the “classic” retinal detachment situation, the jelly-like substance that fills an eye known as the vitreous will spontaneously peel off of the retina. Ophthalmologists call this a Posterior Vitreous Detachment (PVD). A PVD can sometimes cause a tear or hole in the retina. Water from inside the eye then travels through the tear/hole and gets underneath the retina causing a retinal detachment. A good analogy for this scenario is a room filled with water (the eyeball) with wallpaper along the walls (the retina). If there is a hole or tear in the wallpaper, water can get underneath the wallpaper and cause it to detach from the walls.
Other causes for retinal detachment, which are much less common, include diabetes, inflammation, tumors, or trauma.