They are checked according to the marking scheme provided to the teachers checking the answer sheets. The marking scheme has step-wise marking for every questions.
So, even if you don’t know how to solve the solution completely but you still know some steps of it, you would be given marks for them as mentioned in the marking scheme. This is a good thing if you have written the steps correct but final answer is wrong.