The electric brake controllers have an accelerometer in them that senses the deceleration of the vehicle and proportionally adjusts the current to the trailer brakes. More current = more brake on the trailer.
You adjust the sensitivity of the accelerometer in the cab of the vehicle - which you're supposed to adjust with every change in load (empty trailer vs full trailer). Drive in a safe place at a safe speed, apply vehicle brakes, insure trailer brakes don't lock up. If they do, reduce the gain (sensitivity). If they don't seem to engage, turn the sensitivity up. The brakes on the trailer are traditional drum brakes, but instead of a slave cylinder pushing on the shoes, the electro-magnets have friction material on them that drags on the face of the drum. More current to the brakes, more magnetic force, more friction on the drum face, rotates the lever to push on the actual friction shoes (like a slave cylinder would).
It's a stupid system in my opinion
I much prefer the hydraulic version as you describe - we call them "surge" brakes over here. Everything that has electric brakes also has a reverse wire so when you shift into reverse, there is a hydraulic lockout solenoid that lets you back up a hill without engaging the brakes. Much more simple, robust solution - self compensating for the load on the trailer, etc. Unfortunately it's what we've always had what we keep repeating for some reason.