In automotive engines which need oil for lubrication and other uses, an oil pump is required to keep oil flowing throughout the internal components. Some pumps are mechanical, while others are electronic. Mechanical pumps are the most common type found in most applications within a vehicle.
Mechanical Oil Pumps
Most engine oil pumps are mechanical, using the rotational force the engine is already creating to spin a pump. Since its speed is directly linked to the speed of the engine, as the engine spins faster, the pump moves a greater volume of oil.
The engine oil pump shown to the right is a design used on many GM LS series engines. You mostly just see the aluminum shell of the component with the working parts inside. The hole in the middle has a driven splined component which is spun to generate the pumping action inside. The gear teeth create expanding and contracting pockets that pull as they expand and push as they contract. Tolerances are kept tight, as leaks would reduce the pressure and effectiveness of the pump. Some fluid does work as a lubricant for the pump, reducing friction that would otherwise create clearance problems.
Electric Oil Pumps
Some oil pumps are driven electronically. Many modern vehicles use them since they can send oil to the top of the engine before it is cranked over (which is why some owners manuals recommend waiting a few seconds after turning the key to the "on" position before starting the vehicle's engine). An electronic oil pump can be controlled to supply the right amount of oil for the situation.
While electronic oil pumps do have benefits, the downside is that if the electronics powering them fail, the engine is no longer lubricated and can fail quickly. The electrical failure can happen suddenly, while a mechanical pump tends to slowly fail over time, providing symptoms that can lead to its replacement, with little to no engine damage if caught soon enough.
Electrical oil pumps can also be used as a secondary pump, providing added oil movement when needed, or to added components in a custom build.
Automatic Transmission Oil Pump
Automatic transmissions use oil pumps as well, to move ATF to the components that need the fluid and/or pressure. A variable vane pump can regulate pressure by varying its internal shape, but vane and gerotor pumps will have a pressure regulator that dumps excess fluid to maintain a consistent pressure. That consistent pressure not only protects gaskets from high pressures, but also makes gear shifting consistent and reduces the likelihood of unexpected high pressure issues. That pressure regulator is sometimes modified to increase the allowed pressure and provide more aggressive shifting characteristics. Original equipment manufacturers tend to avoid providing harder shifts for comfort reasons rather than reliability concerns, but the aggressive shifting can cause issues inside the transmission.
Inside a Gerotor Pump
The Gerotor pump above is out of a Ford automatic transmission, and is a great example of how fluids are often mechanically pumped in automotive applications.