My textbook has two instances of rolling bodies (smooth rolling). In the first, the body is rolling on the horizontal floor with some acceleration of its centre of mass. In this case, the book says that the friction will act in the direction the ball is accelerating.
In the other instance, the ball is rolling down an incline. In this case, the book says that the force of friction acts opposite to $mg\sin\theta$, the component of the gravitational force parallel to the incline.
I don't understand the difference. I mean, in both the cases, the ball experiences an acceleration due to a force. Why does the direction of friction change? For me the second case was more intuitive. The friction and gravity both induce torques of the same sign on the body.
But I'm lost on the first case. The force that produces the acceleration and the frictional force clearly induce opposite torques which should cancel. Or atleast cancel partially. Also, my intuition says that for the first case, friction should act opposite to the direction of acceleration.
I tried to get answers on the web, but I couldn't find anything that was explained in a lucid manner. Some websites mentioned that the direction of friction is affected if the force is applied at the axle. I don't see why that should be.