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)
### Reverse Pitch - Reverse Thrust

If the pitch angle is negative (reverse), then some meaningful amount of thrust is produced in the opposite direction than normal. This can be useful to improve stopping distance when landing, and even taxi in reverse.
[https://www.skybrary.aero/index.php/Reverse\_Pitch#:~:text=When%20installed%2C%20reverse%20pitch%20is,of%20motion%20of%20the%20aircraft](https://www.skybrary.aero/index.php/Reverse_Pitch#:%7E:text=When%20installed%2C%20reverse%20pitch%20is,of%20motion%20of%20the%20aircraft).

### Zero Pitch - Idling

At somewhere around a pitch angle of zero, the net thrust becomes zero (forward or reverse). At this point the aerodynamic load on the prop is minimized. This removes unwanted thrust when we want to stand still on the runway, as well as minimizes fuel consumption during idle.