The old way was 'throttle cable' like on your lawn mower. Throttle by wire is basically like you describe, a throttle position sensor at the pedal feeding signal to the ECU and it feeding signal to an electric motor opening and closing the throttle body.
That's also how they can integrate systems like traction control, the ECU calculates how much throttle you need without roasting tires, not how much throttle your foot wants.
I guess the correct term would be "throttle by electronic signal" rather than cable