Oil not only lubricate but the also carry heat, hotter oil means hotter machine and that decrease its lubricating effect thus lower engine performance. Oil coolers are used in many gasoline engine and diesel engines and as well as in gearbox (tranmission). It helps to lower the oil temperature to a relative cooler, normally is air cooled from the air flowing across an automobile.
Remember: Oil not only lubricate but also needed to cool and disperse heat away from engine parts, i.e. bearings and high-rev components.