Flowers on gravesites were strictly forbidden by Orthodox rabbis for a long time because of Talmudic rules that nothing can be used for the dead that’s really for the sake of the living.
Pebbles became a more acceptable way of honoring the dead at their grave.
They may have served a dual purpose: the Talmud implies that the soul stays in the grave for a while before going to the afterlife.
The stones could have represented the desire of the living to make sure the souls stayed where they were for a while, by symbolically holding them there.
However the practice began, most agree that the stones represent a more permanent reminder of the deceased than flowers or wreaths, which also die eventually.