Both granite and marble are extremely hard and durable. But both are porous. So, both need to be sealed at least once a year. Sealing blocks acids, and other liquids to penetrate the stone.
In case, the sealant is damaged and liquids penetrate the rock, then more damage is caused to marble. This is because marble is more porous compared to granite. Granite is extremely dense, so it can even prevent acid from penetrating. Therefore, it is advised to wipe off stains immediately from the surface of the marble. Especially acids, they can cause much damage to both the rocks. Use a mixture of vinegar and baking soda in warm water to clean the acid stains.