I agree with you that most books do not follow a logical path when defining thermodynamics terms. Even great books such as Fermi's and Pauli's.
The first thing you need to define is the concept of thermodynamic variables.
Thermodynamic variables are macroscopic quantities whose values depend
only on the current state of thermodynamic equilibrium of the system.
By thermodynamic equilibrium we mean that those variables do not change with time. Their values on the equilibrium cannot depend on the process by which the system achieved the equilibrium. Example of thermodynamic variables are: Volume, pressure, surface tension, magnetization... The equilibrium values of these quantities define the thermodynamic state of a system.
When a thermodynamic system is not isolated, its thermodynamic variables can change under influence of the surrounding. We say the system and the surrounding are in thermal contact. When the system is not in thermal contact with the surrounding we say the system is adiabatically isolated. We can define that,
Two bodies are in thermal equilibrium when they - in thermal contact
with each other - have constant thermodynamic variables.
Now we are able to define temperature. From a purely thermodynamic point of view this is done through the Zeroth Law. A detailed explanation can be found in this post. Basically,
We say that two bodies have the same temperature if and only if they
are in thermal equilibrium.
Borrowing the mechanical definition of work one can - by way of experiments - observe that the work needed to achieve a given change in the thermodynamic state of an adiabatically isolated system is always the same. It allows us to define this value as an internal energy change,
$$W=-\Delta U.$$
By removing the adiabatic isolation we notice that the equation above is no longer valid and we correct it by adding a new term,
$$\Delta U=Q-W,$$
so
The heat $Q$ is the energy the system exchange with the surrounding in
a form that is not work.
Notice that I have skipped more basic definitions such as thermodynamic system and isolated system but this can be easily and logically defined in this construction.
I don't think you need to overthink this so much. Mechanical equilibrium in this context basically means that from a macroscopic point of view, all forces are balanced; this usually also means that the system's parts are at rest, though a system in uniform motion could be considered in mechanical equilibrium, I guess.
The point that the authors are trying to make is that being in mechanical equilibrium (which remember, for our purposes means all net forces are zero and the system is at rest) doesn't necessarily imply that the pressure must be uniform over all the system.
As an example they tell us to consider a column of water inside some container. The water is subject to gravity, so if every small chunk of water is to be at rest, there must be some force counteracting gravity. And indeed there is; in fluids, internal forces come from pressure gradients. Therefore, if the pressure varies as $p = p_0 - \rho g z$ (where $p_0$ is some constant and $\rho$ the density; this is a well known formula in hydrostatics), then the pressure is higher at the bottom. This means that the internal forces, which are equal to minus the pressure gradient, point upwards and cancel out gravity.
Best Answer
The picture below can illustrate the concept of static equilibrium. On a pulley hangs an object A on which acts the gravity with the force $G_A$. If on the other end of the cable there is nothing, the system A + cable is not in static equilibrium and A will fall pulling the cable after it. But, if on the other end we hand an object B of the same weight as A, the system will be in equilibrium: nothing moves, and nothing falls.
A net force appears when the weights of A and B are not equal.
To see this let's write the equations. I consider the positive direction of the forces, upwards, and I write the sign of the forces explicitly.
On the left hand side (LHS) $-G_A$ pulls the cable downwards, and by virtue of the 3rd Newton law the cable pulls the object A with a force of tension, $T_1$, equal in magnitude and opposite in direction to $-G_A$.
(1) $T_1 = +G_A$
On the right hand side (RHS), if there is an object B, there appears a tension force $T_2$ in the cable, also upwards directed.
(2) $T_2 = +G_B$
The two tensions have to be equal, otherwise the cable won't be fully stretched, it will tend to gather on the top of the pulley. For that, one should have $G_A = G_B$. If this equality doesn't hold, the system is not in equilibrium. For instance, assume that $G_A - G_B > 0$. This difference produces a torque on the pulley which rolls the cable. Thus, the object A gets a downward acceleration $a$, and the object B gets the same acceleration (because the length of the cable is constant), but upwards. So, on the LHS we have
(3) $T_1 - G_A = -m_A a$.
On the RHS,
(4) $T_2 - G_B = +m_B a$.
Now, since the cable is fully streched, $T_1 = T_2$.
Let's subtract eq. (2) from (1)
(5) $-(m_A + m_B)a = -(G_A - G_B)$
The net force that acts on the system, is the force that imposes an acceleration to the system. This force is $-(G_A - G_B)$, and the acceleration is
(6) $-a = -\frac {G_A - G_B}{(m_B + m_A)}$ .
Remember, the signs are here explicit.