I've seen many questions asking why their ex is contacting them again and for most, it's self explanatory. For those who genuinely don't know why their ex is contacting them, here are some possible reasons.
1. They want you back
This is usually the case for an ex contacting you again. If you don't want them back, make it clear to them and discontinue contact. Talking to them will only give them hope and they won't give up.
2. They're playing with you
If they broke up with you and they're contacting you, then they may be playing on your heartstrings for the fun of it, especially if the relationship ended badly. If you've been trying to get them back any way possible, showing how upset you are without them but they don't feel the same, they may find it amusing to humiliate you by leading you on or contacting you after saying they would never contact you again. If you believe your ex is doing this to you, don't give them the satisfaction and break all contact. Work on moving on alone, it is possible! Someone like that never deserves a place in your life.
If you broke up with them, then they might be playing with you out of revenge or to give the impression that losing you hasn't affected them, though making such an effort to play with you shows it has affected them.
3. They're making you think about them
Following on from #2, they may miss and love you or they may not, yet in both instances, they still want to know that you're thinking about them. We've all wondered if an ex thinks about us but for some, wondering isn't enough so they'll take matters into their own hands by contacting you. Even if you think about them negatively, they're getting what they want. To them, the more you think about them, the more likely you'll reconsider getting together again. An ex who still loves and misses you may resort to this if they feel they aren't getting any closer to getting back with you after all of their attempts have been exhausted.
4. They can't move on
Not being able to move on doesn't necessarily mean they're still in love with you, they're just finding it difficult to forget a good relationship and good memories. It's not easy to move on from, possibly, a very happy period in their life and from someone who they thought was their everything. If you dated for a long time, made plans for the future and they told you that you were their soulmate or the one, then it will naturally be difficult for them to move on. You might feel that continuing talking to them would be in their best interest to numb their heartbreak, but it would only prolong the healing process for both of you.
5. They're drunk
Maybe you received a text/call from your drunken ex in the early hours and wondered what their intentions were. Being drunk often comes with some deep thoughts and it is believed that who you think about when you're drunk, is who is on your (subconscious) mind for good or bad reasons, so being under the impression that they're thinking about you a lot, couldn't be too far from the truth. However, this doesn't necessarily mean they still love you, miss you or want you back, it could purely be that you're on their mind because they're still moving on and drunkenness makes you do things you otherwise wouldn't do. If you're on the receiving end of this, don't think too much into it. If they truly wanted to talk to you, they would do so when they're sober.
6. They failed to get a new partner
An ex who has been in a rebound relationship or has the tendency to do so, may contact you for this reason. People who go for rebound relationships after a break up don't know how to move on alone so they need something (a person) to soothe the pain as time passes. But what do they do if they can't find someone new to soothe the pain? They go back to the person who once brought them the happiness they previously enjoyed, even though their pain is from the break up. Be careful about mistakingly believing that this means they want to rekindle the relationship. You're their rebound "relationship", no matter how twisted that appears to be.
Conclusively, you're the only one who truly knows why your ex is contacting you seeing as you know what the relationship was like, why it ended and what type of person your ex is. Don't let your feelings convince you to do something you don't want to do, unfortunately, you have to be fairly selfish during a break-up.
Be aware that constant unwanted contact, either through technology or in person, from an ex partner is considered harassment. If your ex partner is making you feel uncomfortable and/or threatened, contact your local authorities.