Question: From what I understand, the purpose of a variable-pitch propeller (be it manually adjustable, or constant speed) is that it allows the engine to always operate at its most efficient speed, much like the transmission of a car. Is that correct? If so, if an airplane were to accomplish that another way (say, a hybrid gas-electric drive, or an actual transmission with shiftable gears\*), would there be any other advantage to having an adjustable propeller?

\*No, I don't know **why** you would want to mount a car transmission on an airplane. It's a hypothetical question. But now I have this picture in my head of a twin-engine plane with two gear shifts in the cockpit and two clutch pedals next to the rudder pedals.

Answer: 
Next to the aerodynamic advantages (both engine and propeller can run at their optimum speed for best efficiency) already mentioned in the other answers, there is an important **safety advantage:** a variable pitch propeller can be **feathered** such that its drag after an engine failure is minimized. This is critical for many multi-engine aircraft in order to remain controllable after an engine failure.

> 
> On many variable pitch propellers, the blade pitch can be increased to the point that the chord line of the blade is approximately parallel to the on-coming airflow. This process is referred to as feathering.
> 
> 
> The inflight feathering of the propeller, on an engine that has failed or has been intentionally shut down, greatly reduces the drag that would occur with the blade pitch in any other position. On a single engine aircraft such as a motor glider, feathering the propeller when the engine is shut down results in a significant increase in gliding distance. On a multi-engine aircraft, feathering the propeller of a failed engine results in both a reduction in drag and a reduction in adverse yaw vastly improving the engine-out handling characteristics and the engine-out flight performance of the aircraft.
> 
> 
> 

([SKYbrary - Feathering](https://www.skybrary.aero/index.php/Feathering))

See also: [What does feathering mean and how does it work technically?](https://aviation.stackexchange.com/questions/11166/what-does-feathering-mean-and-how-does-it-work-technically)
![propeller efficiency with pitch](https://i.stack.imgur.com/k4OLS.jpg)

Propeller efficiency with pitch, taken from Aerodynamics for Naval Aviators, H.H.Hurt, 1965

Fixed pitch props need to be designed for a specific flight speed, which would invariably be a compromise between takeoff and cruise performance. By varying the propeller pitch, we can run the propeller blades at different angles of attack, and we slow the blade tips down to keep their relative speed (sum of freestream and tangential speeds) constant. Thus, we can run the propeller at a similar efficiency through all flight speeds.

Running the blades at certain angles of attack is not as simple as it sounds, with different tangential speeds along the radius of the propeller, the freestream and tangential speeds will yield different flow angles (highest at the hub, least at the tip). To achieve the same angle of attack everywhere along the blade, we'll then need to twist the blade, but as we cannot change the twist in flight, we can optimize only for one flight condition, and be content with a compromise.

![blade twist](https://upload.wikimedia.org/wikipedia/commons/e/e0/Prop_feather.jpg)

Propeller blade twist. Prop's feathered in this picture, prop turns counterclockwise from the pilot's perspective (this blade moves down).

Another aspect is related to the performance of the engine. Reciprocating (piston) engines only recently had electronic fuel injection systems, thus most aero engines are reliant on having a throttle that restricts airflow to the engine to adjust power. To run the engine at part-power with a throttle is quite inefficient, as the engine actively spends power to suck air through the throttle (This is why newer auto engines have variable valve timing and cylinder shut-off and whatnot, to adjust engine power without choking it). By running the engine at an RPM lower than where it produces maximum power, we can run the engine at a higher throttle setting (ideally full throttle) with the same power.

![Porsche 930 dyno graph](https://www.dragtimes.com/images_dyno/21680-1986-Porsche-930-Dyno.jpg)

Porsche 930 dyno graph.
Increasing blade pitch reduces RPM and moves the power (red graph) to the left of the graph, meaning less power at full throttle.

Porsche 930's engine was used as an aero engine by Mooney, with a 0.442:1 reduction gear.