Contact lenses rest on your cornea atop a constant supply of tears. The contacts are also held in place by pressure exerted from the eyelids. When you blink the pressure from the eyelids cause the contacts to move slightly and glide over your cornea. This allows the tears underneath to gently flush out trash or debris that may have accumulated in your eye.
This is just how the contact stays on the eye and is able to provide a way to correct vision. The way the vision is corrected is a different story altogether.
Contact lenses are prescribed to a wide variety of individuals who have vision problems associated with astigmatism, nearsightedness, farsightedness, and presbyopia. The retinas of individuals who suffer from these conditions cannot properly focus light. When the retina does not function properly and/or does not properly focus light then the result is imperfect and blurry vision.
Contact lenses are made differently depending on the eye condition they are trying to correct. For instance, if you suffer from astigmatism your optometrist will measure your cornea so a contact can be made precisely to fit your eye. By doing this a contact is made that will fit your eye perfectly and direct light rays to one place on the cornea, which in turn corrects your vision.
Those suffering from myopia, also known as nearsightedness, will wear lenses that are thinner in the middle and thicker on the edges. This design allows the light rays to be processed correctly by the retina.
Farsightedness sufferers are prescribed just the opposite contact lens, but with the same end result. They allow the retina to process light correctly as well, resulting in corrected vision for the wearer.
All contact lenses use the basic technology to correct vision for the wearer. They redirect light to the retina so it is processed correctly. The only difference is contacts are made differently to treat different eye problems.