In Daniel Schroeder's book Thermal Physics, he makes the point that as energy is put into a system it's entropy goes up (there are some exceptions to this generally, but for this question we can ignore this). However, as energy is put into the system, the entropy keeps increasing, but by lesser and lesser amounts. We also define the reciprocal of the change in Entropy over the change in Energy as the Temperature of the system:
$$\cfrac{1}{T} = \cfrac{\partial S}{\partial U}$$
This all makes sense: A lower temperature object is one where much entropy is gained if energy is added to it, and a higher temperature object is one where very little entropy is lost if energy is removed from it. From this, it is easy to see why the higher temperature object will spontaneously give energy to the lower temperature object if they are put into thermal contact with each other.
This also makes sense from the interpretation of entropy as the number of "microstates" of the system. Sure, removing energy will make the microstate of higher temperature object more certain (because there are now fewer of them), but having the lower temperature object receive that energy will add much more uncertainty to the microstate, more than making up for the microstates lost in the higher temperature object's system.
But if all this were true, then it shouldn't matter how energy enters/exits my system. That is, it shouldn't matter if the energy comes in/out via heat flow or whether work was done on it. Certainly, we can see in the above formula for temperature that the temperature depends on how the entropy $S$ changes when there is a change in the system's energy $U$. There is no reference to $Q$, the heat put into the system either in the formula or in the interpretation of entropy above.
Which is why I'm confused when he speaks about heat engines. Schroeder tries to determine the maximum efficiency of a heat engine that takes heat $Q_h$ from a hot reservoir, puts out work $W$ and dumps out heat $Q_c$ as waste. Starting with the definition of efficiency $e = W/Q_h$ he puts in two constraints. The first constraint comes from the First Law of Thermodynamics and makes sense:
$$Q_h = Q_c + W$$
The second constraint comes from the Second Law and has me confused:
$$\cfrac{Q_c}{T_c} \ge \cfrac{Q_h}{T_h}$$
Why is there no term for any entropy carried out when work was done on the system? In other words, why isn't the Second Law constraint like so:
$$\cfrac{Q_c}{T_c} + \cfrac{W}{T_?} \ge \cfrac{Q_h}{T_h}$$
(I suppose $T_?$ would be the temperature of the engine, between $T_c$ and $T_h$, when it is doing the work.)
Yet the constraint is not written this way, so why does taking work from a system not reduce its entropy??