Chess.com tracks when people do that. It can happen legitimately (if you lose your internet connection, etc.), but if you do it too many times, you start to face consequences. These consequences can include being forced to wait between games and being paired with other people who do the same thing.
Is it allowed to name players who disconnect when in a hopeless position?