[clause],[subject] + 却 + [verb phrase]
虽然 + [clause],但是 + [subject] + 却 + [verb phrase]
却 marks the second of two clauses as running against the first. It is an adverb: it goes after the subject of the second clause and before the verb, never in front of the subject. It is neutral to slightly written.
但是 is a conjunction and stands before the subject; 却 is an adverb and stands after it. They can share a clause, and often do after 虽然.
When the two clauses share a subject, the second can drop it and begin with 却.
却 only says the two facts clash. 反而 goes further: the result is the opposite of what the first clause should have caused.