Read the statement and picture to answer:

A ball is released from the point P and moves along an inclined plane and then along a horizontal surface as shown in the image. It comes to stop at the point A on the horizontal surface.
Why does the ball finally come to rest at point A on the horizontal surface?