how do we know about parts of Buddha's life where he was clearly alone? for example, when he was being tempted by Mara, he said "the Earth bears witness." how do we know this? he was clearly alone, right? no one was there witnessing this to write about it. did Buddha just tell it to everyone later? not just that, there are so many instances in his story where he was clearly alone. no one else could've known about those moments to write about them.
Some of it is in suttas, see for example Buddha meditation under the bodhi tree

The detail you mentioned come from the introduction to Jataka -- Where is the description of the vow and the Bodhi tree? 

Parts of the Jataka might be described here as "a charming story" -- see also Does Theravada Buddhism accept Jataka Stories?

See also Why did the Buddha touch the earth at his enlightenment? -- people understand that as instructive.