In brief
The position of the pedal can be transmitted as a signal to the engine control.
Useful to know
The throttle module includes a pedal and an angle sensor. Bosch describes potentiometric or contactless Hall performance. The control uses the motion and position to calculate the stated torque. [1]
This means that pressing is an input to a control system, not necessarily a direct mechanical opening via a stinger. Other conditions and functions of the car may also be involved in the final control of the engine.
Don't confuse the pedal sensor with the throttle position sensor. One takes into account the driver's action, and the other gives feedback on a managed component. In a problem, the exact code and the specific parameter are more useful than the general "gas is electronic". A different reaction is not enough in itself to select a new pedal module.
Sources
For further detail and to check the information: