There are computer programs, such as Turnitin, which can detect plagiarism. Also, markers generally have a good knowledge of the area, so will recognise where many things came from.
edit: also, your writing style may change when you're using someone else's work. This is usually pretty easy to...