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.
I agree, but would like to point out that sometimes this might not be what you want. I had a bike with a front motor and a cadence sensor that I used for my commute for a few years, and was very happy with the motor just pulling me along while I lazily pushed the pedals with ~zero torque, barely enough to let the bike know I'm there. Basically like pressing a throttle. If all you want is to get from A to B comfortably, I've found this to be superior to a torque sensor, and it was also dirt cheap.