If Muhammad never existed, how did his grave come to exist?
Ignoring the religious argument you opened up with your question lets answer it anyway. Graves are a shrine to the deceased. They are not always made with an actual body. For example in war a soldier may be know to be in a tent hit by artillery fire and there be no actual remains. A person can be a fisherman and lost at sea and still have a grave site for family to visit and mourn. Many nations have tombs of the unknown soldier for all the dead who were unrecovered from their conflict.