Typically, immersion media is used to increase the numerical aperture (NA) by a factor equal to the index of refraction of the media. This allows high NA objectives to go beyond the limit of NA = 1, but it also has application in low-power imaging, as discussed on the Olympus Microscopy Resource Center.
As shown in the figure above (from Olympus), the addition of an immersion media allows high NA rays to enter the objective, when otherwise they would not.
Usually, an oil (synthetic, or natual cedarwood) is used, but water immersion objectives also exist, as well as other media. The Olympus page has a list of common ones. I have Cargille Labs oils Type B, as well as Type FF (fluorescence free).
Oiling the condenser doesn't seem to help with resolution (NA) so much as it greatly increases the optical throughput, making the image much brighter.
The ideal immersion medium would: be non-toxic, non-staining, non-drying, highly viscous, yet unable to trap air bubbles, 100% transparent at all wavelengths, have no self-fluorescence (fluorescence in the media creates background light, reducing contrast), and able to index-match to whatever glass it touches. Of course, no such medium exists, so you should select a medium which best suits your needs.