Given the economic opportunities that grades open up, I don't think it is fair to say "they are only cheating themselves." They are cheating others out of work and/or scholarship money, too.
Well, maybe. It really depends on how much the grades count. But yes, that is also a factor, agreed.
Well, if we realize that the North American system of education is rather unusual in that your future is really put in the hands of the student, and go with the system used around the world where they have a major test at various points of their academic career that determine their future. A common one is a major test at the end of what we would traditionally call high school, though there are often a smaller test going from elementary to middle, and middle to high school. But generally speaking, the high school test is the major one that really matters.
That one test often determine's a person's role in life. Do well, and you can get a full ride scholarship to an overseas university - including a stipend for rent and living expenses. And usually, it's any university you want - a prestigious university at any country you want - US, Canada, or Europe. You'd just have to apply and qualify to get in (but usually you're a shoo-in if the country is paying your way).
Do reasonably well, and you might get a scholarship to a local university. Not as good, but hey, it's still a university education. If you don't do as well, you get an opportunity to go to university.
But bomb the exam? Your academic career has come to an end. If you're lucky, maybe you can find a trade school that will take you in so you can at least get a job in the skilled trades. Otherwise you're now on your own - get a job with a basic high school education and no experience. Maybe you can find a job as a laborer and if you're really lucky, the company will provide advanced training so you can climb the corporate ladder from the very bottom.
Note that I did say "on your own". It isn't unheard of for families to basically disown their kids who end up in this bucket. It's also why many of these countries have extremely high rates of teen suicide - the amount of pressure imposed has cracked many young people. It's not just the one test to rule them all, the family often puts immense pressure on their kids to do well. Especially if the parents belong to some high class occupation - doctors, CEOs, etc., Either they crack from the pressure - the intense studying after homework, the weekends spent getting tutored, and the build up to the big day. And if they feel they bombed it, well, their parents might see them off to school for the test, but they never show up at the end of the school day.
Countries often have special restrictions on exam day - many prohibit being on the roads unless it's an emergency to ensure the roads are clear for students to get to the exam center. They may also prohibit flights and heavy traffic so the street noise is suppressed, etc. Companies also know it - release dates of products are often scheduled after exams - the PS2, for example, was released after exams in Japan to encourage students to do well so their parents would reward them with one.
The incentive to do well on the exam encourages cheating. They may be cheating themselves, but given the amount of "fake it until you make it" going around, especially among the billionaire and trillionaire class, they figure it'll be something they worry about if they get through.
Contrast that with the American education system - if you don't make it, but still want it, you can try again, or try alternatives - your future is not decided by a single test, but is completely open and many career paths can lead to the same outcome