Ahh this was interesting for me learning Russian because my question was the reverse , "How does земля distinguish between these things?'

Earth -
1. Treated as an element (fire, water, air, earth). Refers to soil and natural ground as a substance.

2. The planet as a celestial body:

a) Earth - Earth as a planet, among other planets. (We don't say "the Jupiter," we just say "Jupiter..." or "Neptune") Here you could say "an Earth," as in those sci-fi scenarios where someone has made a copy of Earth, similar to how you could say somewhat jokingly "a Joe" if talking about multiple "Joes" or Joe clones or something. Basically without the "the" it treats 'Earth' as a name, almost even as a person (like Mother Nature), like a personified character who acts and is acted upon

b) The Earth - Treats it more like an object, like "the table" or "the large habitable rock." Anything "the Earth" does, it does without agency, whereas it is as if "Earth" acts of its own accord.

This is an incredibly wishy-washy and blurry description. I can't really find a single case where the two *aren't* interchangeable, honestly.