Cavalry means troops on horseback, and now armoured units that inherited the role. Calvary is the hill outside Jerusalem where, in Christian tradition, Jesus was crucified. The letters are transposed, and only one of them is a place name.
The core difference
Mounted troops and a hill, separated by a letter swap.
- cavalry — mounted troops; now armoured units: the cavalry charge, the cavalry arrived.
- Calvary — the site of the Crucifixion; figuratively, an ordeal.
The roots
Cavalry is from Latin caballus, horse — the same root as cavalier and chivalry. Calvary is from Latin calvaria, skull, translating the Aramaic name Golgotha, "place of the skull".
The figurative use
A calvary can mean a prolonged ordeal or period of suffering, from the association. That use is capitalised or not depending on whether the specific place is meant.