I'm no expert in this but I suppose just like how they check for plagiarism in essays.
They usually compare submissions with other submissions, past submissions and also against similar references on the internet in case a match is found on some website.