How could you cheat? This is what the Lichess terms of service say about it:
Cheating. We define this as using any external assistance to
strengthen your knowledge and, or, calculation ability to gain an
unfair advantage over your opponent. Some examples would include
computer engine assistance, opening books (except for correspondence
games), endgame tablebases, and asking another player for help,
although these aren’t the only things we would consider cheating.
The most common form of cheating is using an engine. I don't know the details of what Lichess does, but cheating detection can consist of comparing a player's moves to those proposed by various engines, and based on statistical analysis one can come up with criteria for when the player's moves were "suspiciously similar" to an engine's.
Lichess also allows people to register bot accounts, but those must be clearly labelled as bots. So I suppose that another form of cheating could be to create a bot account and pretend that it is a human.
I also found this old FAQ:
- How are cheaters identified?
- Using the suspicious games themselves. The degree to which computer players differ in playing style and strength, to most human opponents
that rely on them, is in most cases enough to reverse-engineer
information from the game beyond what moves were made.
- Using the player's other games. A player's profile shows all their games, including games where it is apparent that there was no
cheating. Games where a player cheated and games where a player did
not cheat have very different results when reviewing them using a
chess engine (or Lichess' computer analysis feature).
- Using the player's history. On every player's profile are public graphs of rating and average history, game database exports upon
request, and win to loss ratio.
- Time statistics. Anyone can see the public time consummation information for games, i.e., the time-per-moves.
- A statistical analysis of the suspected user's playing behaviour. This statistical analysis is only visible to the lichess team.
- Copying and pasting the suspicious game(s) into an engine and seeing how similar the moves are.