All the comments made are good. I just wanted to expand a bit more on what Siebe mentioned.
There are mainly two types of “Māra”, even though the first kind may have more subdivisions. They are both bad.
One is called “kilesa Māra”. These are one’s own defilements. By the way, kilesa means “defilements”. They can be hidden below the surface as anusaya and may be “hidden” for long times, especially when one has a good, steady, moral mindset.
-However, those hidden anusaya (“kilesa Māra”) can easily come back up under suitable conditions. When one’s mind is agitated or when the sense inputs become strong, they can come to the surface.
The second is called “Māra deva”, sometimes called the “Devaputta Māra”. He is an actual deva in the Paranimmita vasavatti deva realm, which is the highest deva realm. Obviously, he is could not have been there without doing good deeds. And that is actually the problem. He thinks people should be moral, do good deeds, and be born in deva realms just like him. But he is scared of Nibbana (just like many “secular Buddhists” today; see, “Buddhism without Rebirth and Nibbana?“.
– When the Bodhisatva was striving for the Buddhahood, he tried to convince the Bodhisatva that he should give up trying to find Nibbana and just enjoy worldly pleasures. After the Enlightenment, he came to the Buddha several times asking when he was going to attain Parinibbana.
– There are also several accounts in the Tipitaka where the Māra deva tried to discourage bhikkhus and bhikkhunis from following the Path. Buddha always called him “the evil one”.
So, both are real, and should be taken seriously. We should be aware of these possible obstacles. If one deviated from the Noble Path, it is easier for both those to influence one’s mind in negative and harmful ways.