The tires (or ball) want to travel in a straight line and friction (traction actually) make it deviate from the line.
Friction (acting on the direction of travel) is present on both cases. For the car there is the additional effect of traction which enforces the going around the bend part. The ball is going on a straight line and so no traction is needed.
Visualize the car on ice, making the tires slip. Relative to the bend (desired motion) the tires slip away and friction is opposing this motion. On normal roads you do not observe this slipping, but it happens. Look up "Tire Slip Angle" and you will learn a lot about it.
This slipping towards the outside of the circle is what generates the tire friction, and it is the same mechanism with you trying to slide a box in a straight line. Friction will oppose this motion.