They both seem very similar but can someone please explain their main differences and principle of operation?
A trim tab is operated by an independent control to a variable position that is normally fixed once set, unless readjusted, and is done to cause the control surface to aerodynamically want to hold a position that is different from its normal "trail" position, without any input from the cockpit end. Think the typical elevator, aileron, or rudder trim used to correct a roll or yaw tendency, or to set the "hands off" trim speed in the case of elevator trim.
A servo tab is integrated into the flight control's operating components in such a way as to drive, or help to drive, the control surface during normal control inputs. Sort of "poor man's power steering".
You can use a servo tab to operate the control surface, that is otherwise free to trail in the airstream, completely on its own. The stick in the cockpit is connected only to the servo tab itself. Such control surfaces will often hang down at the bottom of their travel until airspeed "blows" the surface into its normal trail position, from where the servo tab then drives the surface up or down based on cockpit control inputs. DC-9s and Bristol Britannias use pure servo tab operated flight controls.
Or you can use the servo tab in conjunction with a normal control circuit to boost a normally mechanically operated surface, by mechanically gearing it to move in a way that applies a local aerodynamic load that helps with the pilot control input, like having someone push on the trailing edge to help you while you move the controls.
There is a kind of hybrid arrangement you will see sometimes, called a "Spring Tab". This is a servo tab who's input linkage is also connected to the control surface by a torsion spring torque tube, typically on an elevator system. When you move the control in the cockpit, the control circuit input drives the surface directly, but though the springy torque tube so the surface lags the input to the extent that the torque tube twists under load. When the torque tube twists, at the same time the input side is connected to a servo tab that displaces to help the surface move. The surface works like a pure servo tab driven one with small inputs, but as the inputs get larger there is more of a direct force acting on the surface from the torque tube like a regular control.
This is used to get the light control forces you get with a pure servo-only driven control surface, but with the ability to still drive the surface directly to full travel when called for. Spring tabs are popular on DeHavilland Canada transports like the Dash 7 and Dash 8.
Then there is the "anti-servo" tab. The anti-servo tab, by gearing to move in the opposite direction to a servo tab, is used to deliberately increase the normal restoring forces working on the surface when displaced from its trail position. You might add an anti-servo tab because the control forces are too light, or you want light forces near neutral but want the forces to build faster than they would without the anti-servo tab.
Mechanically operated "all flying", or Stabilator tails, such as used on the Cessna Cardinal and Piper Cherokee line, depend on an anti-servo tab to provide all of the restorative forces for the control surface, for basic stick-free static pitch stability. They actually do double duty, and at the same time have an adjustable fixed "neutral" position, varied by the trim wheel in the cockpit, that provides for normal elevator trim (speed seeking).
From this answer:
The servo tab is an aerodynamic lever. It is connected directly to the pilot flying controls.
The trim tab has a constant angle relative to the control surface. The angle can be changed by extending/retracting a mechanical link, via a trim wheel or an electric motor with a screw jack.
Seen from outside, the tabs look pretty similar. The difference is in how they are moved, the servo tab connects directly to the flight controls so that when the pilot moves the flight controls on the ground, only the servo tab moves, not the control surface. With the trim tab, the control surface moves on ground and the trim tab stays at the angle set by the trim tab actuator.