Although motor oil is primarily a lubricant, it also serves as an extremely effective method of heat transfer. After all, oil is what comes in direct contact with moving parts - not coolant. Just to make a point about how effective oil is at redirecting heat, air-cooled engines (think old-school VWs and Porsches) not equipped with traditional liquid cooling systems rely on motor oil as an effective cooling method.
Because automobile engines power heavy loads at high speeds, and are driven in all kinds of ambient temperature extremes, they need a serious level of cooling. Approximately two-thirds of an automobile engine's heat is transferred into mechanical power or escapes out the exhaust pipe - leaving the other third as excess heat that must be removed. To do this, liquid coolant circulates through channels in the engine block in order to remove the majority of engine heat, but coolant alone can't do the job completely without help from engine oil. Coolant may remove heat once it's been transferred to the engine block, but oil removes heat from critical moving parts such as camshafts, crankshafts, bearings, connecting rods, and pistons while it's being generated. Because oil works so well, jets of it are also sprayed onto the undersides of pistons in higher-performance engines. And when turbochargers are part of the equation, oil does the bulk of the work in removing heat from rapidly spinning bearings.