I feel a need to add a "simple" answer, because the book is making this needlessly confusing for you.
Given an object with width b and height h, with weight W, we make the following assumptions:
- Center of mass is at the center of the object
- Coefficient of friction $\mu$ is sufficient to prevent sliding
Now we can draw the diagram at the moment that the object topples (that is, when the object is supported entirely at the corner, and the net torque is zero):
I did not show the reaction forces at $O$ which are the force of friction (horizontal, magnitude $F$) and the normal force (vertical, magnitude $W$): they are of course necessary to talk of "torque" but they make the diagram more complicated. I hope you can forgive me...
Torques about point $O$ are zero when
$$F\cdot h - W\frac{b}{2}=0\\
F = \frac{Wb}{2h}$$
Note that we have to assume that $\mu W > F$ in order for this to occur at all.
The thing that makes the question more complicated than necessary (and why you are struggling to understand it) is the addition of a distance $x$ (which I deliberately did not show in my diagram). This is useful when you want to figure out the apparent point of equilibrium of the object - basically, if you start pushing on the object, there will be a shift in the apparent location where the normal force acts on the interface between the object and the support below it. Solving for this apparent location (setting it to zero - i.e. acting on the corner) is what the book's solution did; I consider that a confusing way to introduce a simple subject.
One interesting aside: if the surface properties were not constant (for example, if the right hand side was ice while the left is concrete) then this concept of "apparent location of normal force" starts to make sense, and you could see that the object starts to slide when a certain lateral force is applied (the normal force on the concrete would become less, and if we assume the ice is frictionless the additional normal force on that side would not prevent sliding). So I'm not saying that the approach taken here is completely useless - just that I would prefer to start simpler...