To repair is to prepare again. The word comes from Old French reparer, from Latin reparāre — re- ('again, back') plus parāre ('to make ready'). Something broken has lost its preparedness; repairing it restores that state.
Latin parāre was a workhorse verb meaning 'to make ready, to furnish, to provide'. Its descendants in English are connected by this theme of readiness. Prepare means 'to make ready before' (prae- + parāre). Compare means 'to pair together' (com- + par, 'equal' — itself related to parāre). Separate means 'to set apart' (sē- + parāre). An apparatus is a set of things made ready for a purpose.
Reparation — the act of repairing — took on a specific meaning after the First World War. War reparations were payments meant to restore (repair) the damage done to the victors' countries. The word treats entire nations as broken things that money might fix.
There is a second English word repair, now archaic, meaning 'to go to a place' — as in 'they repaired to the drawing room'. This comes from a different Latin root entirely: repatriāre, 'to return to one's country'. The two words are unrelated despite identical spelling.
The repair that means 'to fix' entered English from Old French in the 14th century and has held its meaning with unusual stability. Its logic remains transparent: damage undoes preparation, and repair re-does it.