In 5e, things that refer to magic only interact with entities that have/are magic as part of their crunch, not fluff. To determine if something is actually magic, rather than described as magic but totally not actually magic, use the rule on page 17 of the 2017 Sage Advice Compendium page 17 of the 2017 Sage Advice Compendium:
our[O]ur game makes a distinction between two types of magic:
• the background magic that is part of the D&D multiverse’s physics and the physiology of many D&D creatures
• the concentrated magical energy that is contained in a magic item or channeled to create a spell or other focused magical effect
- the background magic that is part of the D&D multiverse’s physics and the physiology of many D&D creatures
- the concentrated magical energy that is contained in a magic item or channeled to create a spell or other focused magical effect
In D&D, the first type of magic is [fluff] ... The second type type of magic is what the rules are concerned about. When a a rule refers to something being magical, it’s referring to that that second type. Determining whether a game feature is magical magical is straightforward. Ask yourself these questions about about the feature:
• Is it a magic item?
• Is it a spell? Or does it let you create the effects of a spell that’s mentioned in its description?
• Is it a spell attack?
• Is it fueled by the use of spell slots?
• Does its description say it’s magical?
- Is it a magic item?
- Is it a spell? Or does it let you create the effects of a spell that’s mentioned in its description?
- Is it a spell attack?
- Is it fueled by the use of spell slots?
- Does its description say it’s magical?
If your answer to any of those questions is yes, the feature is is magical.
Let’s look at a white dragon’s Cold Breath and ask ourselves those questions. First, Cold Breath isn’t a magic item item. Second, its description mentions no spell. Third, it’s not not a spell attack. Fourth, the word “magical” appears nowhere in its description. Our conclusion: Cold Breath is not considered considered a magical game effecteffect[.]
(Note that 'described as magic' here means something other than what it normally means, since Whitewhite dragons, as the entry notes before this passage, are described as magical. It seems like the author means 'in its description' to mean 'in the part of its description where the rules go, you know, its actual description', - but that is contrary to how the authors have claimed you should read spells etc(etc.) to prevent certain kinds of textual ambiguities and errors from being problems, so make of it what you will.)
This is a helpful starting place, but not sufficient; we still don't know how instantaneous spells with long durations or secondary effects of spells work. For the former, it helps that the rules say about instantaneous spells:
Many Spellsspells are Instantaneousinstantaneous. The spell harms, heals, creates, or alters a creature or an object in a way that can’t be dispelled, because its magic exists only for an instant.