With sand and coral, it's simply a matter of whether you're talking about the substance in general, or some specific example of it that has already been mentioned (or is contextually obvious).
With tide, the article is always included, even though it doesn't refer to anything specific. People are always talking about things that come and go or rise and fall like the tide. Everyone knows those are things tides do, so we don't need any particular tide for comparison.
If there are any general principles governing whether the article is optional, required, or invalid/unlikely, and whether including it makes any difference to the meaning, I'm not consciously aware of them.
1: God's presence released upon us is like [the] rain that falls upon the earth (Source)
2: May he be like [the] rain that falls on mown grass (Source)
As it happens, #1 includes the article and #2 doesn't. But I can't see it would make any difference if that position were reversed. I'm sure I could think up further examples where the article either does affect meaning, or doesn't work, at all. But I don't think there's any obvious pattern to such usages - you just have to get used to them one by one.