When the car brakes, the ball continues to maintain its forward speed due to inertia.
Then you continue to analyze the relative relationship between the ball and the contact surface, and you can know that as long as the contact surface is uneven, the horizontal component of its supporting force for the ball will provide the acceleration of the ball in the horizontal direction, while the vertical component is the source of the momentum of the ball in the vertical direction after deducting gravity.