Why do People cheat?

I always had this question, why do people cheat? Cause it's getting very common these days, every other story I hear is that they broke up cause of their partner cheating, and extra marital affairs have also been increasing so,

Why do people cheat? Is it attention? Or due to some emotional issues? Or due to bad sex? Like they crave more attention? Or more emotional intimacy or just better sex?

I don't know about women, but for men it can be better sex, cause I have seen how they justify sex and have that exploration kink, like how would be it feel with different people! Not everyone though, this is just what I have observed from my 2-3 aquitances.

As I have never been in a relationship so I always think how can someone cheat on the other one whom they once loved, but then when I think it from their pov, it feels little justified, cause after 4-5 years it would get boring!

And what is your say on this? Would you cheat then what would be your reason, more attention, better emotional intimacy or better sex?

Edit: Don't get the wrong idea guys I am not at all promoting cheating neither I would like to or would like others to do it, I just wanted to know what goes in the mind of people who do it!