There's really two questions here: when to use the article "the", and when to capitalize the word ("Earth" vs "earth").
The first example ("around the Earth") technically should be either "around Earth" or "around the earth". When used as a common noun, it's frequently lowercase, and used with the article ("the"). When it's a proper noun -- like a person's name, "Bob", or even "God" vs "the god" -- then it's capitalized ("Earth"), and often without the article ("the"). And sometimes the word "earth" is simply unnecessarily capitalized, and no one notices, because no one agrees on a single standard usage.
In general, when referring to the uniquely named Planet Earth, especially in the context of other (also capitalized) celestial bodies, then we're usually capitalizing, with or without "the".
Unofficially, if the sentence makes sense by substituting "Pluto" for "Earth", then use that as a guide whether to use "the". For example: "It orbited the Pluto" vs "It orbited Pluto" -- the second is correct, so prefer "It orbited Earth". But either option would actually "work" for "Earth".
But, in any case, if you're shoveling dirt, you're definitely shoveling "earth" (common noun); not "Earth", nor "the Earth". If you're using colloquial phrases like "what on earth are you doing?", then it's also lowercase.
As another complicated example: style guides used to capitalize "the Internet" when referring to that thing on which the World Wide Web is built; except when used as a common noun, for the generic "internet" technology. But more recently, it's been demoted to just "the internet". So sometimes, English (or is it "english"?) is simply a work in progress.