Q: I sort of understand the D major because it's present in the A major (parallel of the Amin in which the song is in) but what's going on with that E major?
A: if the "from A major" explanation satisfies you, then i am proud to inform you that E is present in A major too