Electronic balances use a device called a "load cell." The full name is "strain gauge load cell."
First a little background: a "strain gauge" is a thin device, smaller than a fingernail, which changes electrical resistance when it is stretched or compressed. If you glue a strain gauge onto a metal bar, you can determine how much the bar is bent by measuring changes in electrical resistance of the strain gauge with a meter.
Typically, several strain gauges are used in Wheatstone bridge arrangement and they are glued onto the load cell in a protected location.
A load cell is usually in the shape of a beam or plate. When you push on the beam or plate with a force, it bends a tiny amount, and this tiny bending is detected by the strain gauges. The amount of bending might be only a thousandth of an inch, but that is enough for a strain gauge to measure.
Fancy load cells can measure forces in three directions and also torques around three axes.
A load cell can only measure force. An "electronic balance" can thus only measure weight. If you take your electronic balance to the moon it will not measure right.
(If you take a beam balance, the kind of one with weights that you put on a pan, to the moon, it will measure mass correctly because the mass weights on both pans weigh proportionately less.
If you do an Internet search on "load cell" you can learn all about them.