> the bike with the cadence sensor seems to decide how fast it wants to go

Well yes, because there’s no other input. It’s an on/off switch, the bike just knows that you’re pedaling. Usually there are multiple power levels you can switch between with a button, and those decide roughly how much of a push you get from the motor, but the power curves are all “hardcoded”. It doesn’t feel great for active riding, but it’s adequate for commuter bikes. Torque sensors are actually kind of expensive on their own.