How are the 737’s elevator and aileron cables attached to their control tabs without impeding the control surfaces’ motion under hydraulic power? The 737 (all versions thereof) is one of the few jetliners still in production to have any manual-reversion capability for its flight controls in the event of the loss of all hydraulic systems.  If hydraulic pressure is lost in both the A and B hydraulic systems, control tabs on the elevators and ailerons unlock, and the elevator and aileron control cables, which are directly attached to these tabs, deflect them to produce aerodynamic forces that move the elevators and ailerons in the desired direction.1  When hydraulic pressure is available in either of the two primary systems, the control tabs are locked to their respective control surfaces and move with them.
Thus, the control tabs - which are still attached to the control cables even when locked to the elevators and ailerons under hydraulic power - deflect in the opposite direction when the flight controls are being moved hydraulically compared to when in manual-reversion flight.  For instance, when a pilot commands up elevator in hydraulic flight, the elevator actuators move the trailing edge of the elevators, and of their control tabs, upwards, even as the control cables themselves are trying to pull the trailing edges of the elevator control tabs downwards (as would be necessary when commanding up elevator in manual-reversion flight).  How does the 737’s flight-control system prevent the forces generated by the hydraulic flight-control actuators from feeding back through the control cables (via their attachments to the elevator and aileron control tabs) and forcing the pilots’ yokes in the direction opposite their control inputs, or, alternatively, the forces exerted directly by the control cables from impeding the control surfaces’ motion when under hydraulic power?

1: Not all of the 737’s control surfaces have provisions for manual control; the spoilerons (which deflect asymmetrically to assist the ailerons in rolling the aircraft) are inoperative if the A and B hydraulic systems both fail, while the rudder (which provides yaw control independent of roll) can be powered by the third, standby hydraulic system2 if both the A and B systems fail, but does not have manual-reversion capability in the event of a failure of all three hydraulic systems.
2: The standby hydraulic system (which can provide hydraulic power to move the rudder, actuate the thrust reversers, and - if the ALTERNATE FLAPS switch is engaged - extend the leading-edge high-lift devices) is normally unpressurised, but can be manually activated by the pilots (and activates automatically in the event of a hydraulic failure during critical phases of takeoff and landing); this is generally done in the event of a failure of one or both main hydraulic systems, but the standby system can be engaged even if both the A and B systems are fully operational (useful for clearing some types of rudder jams, although less so nowadays than was the case with the 737’s pre-2008 rudder-control system).
The tabs themselves are not locked -- that lock you mention is upstream: an input lock. Next time you sit next to the wing, watch the aileron as the pilots check the controls and notice how the tab moves opposite (alternatively, and rewindable, you can watch it here).
With the input locked, the tabs are free to move without directly feeding back into the actuators/rods/cables (indirectly though, the elevator tabs serve two different functions depending on the flight regime).


Source: b737.org.uk

Above is a photo for the elevator/tab deflection as seen on ground with the elevator up and tab down. And when unpowered, the elevators droop, and the tabs would be trailing edge up as expected, as seen in the following photo:


Source: wikimedia.org

The mechanism
For the elevators, the cables (from the control column) move the aft control quadrant. From there, no more cables -- a rod moves a differential (floating) lever, which is the input to 1) the hydraulic actuator 2) the manual reversion lever (either/or).
With hydraulic power available, locking pistons lock the manual reversion lever (not the tabs). With loss of hydraulic power, the now unlocked manual reversion lever changes the differential lever's pivot point -- switching the input to the aero tabs.
Here's a drawing from Boeing's manual reversion patent. I colored the differential lever yellow and the manual reversion lever red (locking pistons are shown in another figure), and drew the two pivoting axes:


Source: patents.google.com

This is how with the manual reversion lever locked (hydraulics working), elevator movement would move the tabs in the correct non-impeding opposite direction (rod 34 need not translate), e.g. pull back - elevators up - tabs down. This is also illustrated in Fig. 5 in the patent.


Source: gov.uk/aaib-reports

Above are the rods that move one of the tabs on a 737-700. The ailerons are covered by the same patent (same principle).
But that is not all
At low-speed, triggered by the extension of the TE flaps, a hydraulic/spring mechanism shifts the pivot point of the tabs, which in turn reverses the tabs behavior, making the tabs follow the elevators, e.g. pull back - elevators up - tabs up. This increases the camber giving more control.
The relevant Boeing patent is here; it's an earlier design where each elevator had two tabs, as seen on the 707:


Source: publicdomainpictures.net

On the 707 (and KC-135, etc.), the inboard tabs are the convertible type -- their anti-balance mode is to make the pitch control heavier in cruise; the balance mode is used at low-speed (activated by stabilizer position) to counter the increased air loads on the elevators' top surface when the stabilizer is more nose down. (The 707 pitch/roll is not hydraulically powered.)
When the elevators are pushed down by air loads, the inboard tabs would already be down, keeping the elevators at neutral (no input required), otherwise the stabilizer effectiveness would decrease. And with any input, they would assist -- that's opposite the 737 at low-speed as noted earlier. The mechanism for the convertible function on the 737NG is seen in the following drawing:


Source: slideshare.net

At low-speed and with no hydraulics available for that mechanism, the tabs remain in the balance (assist) function -- move opposite the input, in order to the move the elevators as intended in manual reversion.
Finally, here are the different tab deflections during maintenance testing (elevators are up):


Source: b737.org.uk

To summarize: the lock is for the input (therefore no impeding action), and the tabs on the 737 do a lot behind the scenes.