A 12% rate in an economy with 15% inflation is a negative real rate and no reason to hold that currency. A 4% rate with 1.5% inflation is a positive one. Cross-border capital chases the difference in real terms, which is why the real interest-rate-differential explains more currency behaviour than the nominal one.
Definitions vary: ex-post uses realised inflation, ex-ante uses expected inflation, and market-implied versions read the real rate off inflation-linked bond yields. Traders generally use the last of these because it is forward-looking and priced continuously.
Real rates are also the cleanest link between a central bank and its currency. A hiking cycle that merely keeps pace with rising inflation does nothing for the currency; one that outruns inflation usually does.
Example: country A at 5.25% nominal with 3.4% inflation has a 1.85% real rate. Country B at 4.00% with 5.2% inflation has minus 1.2%. The real gap is 3.05% in A's favour, wider than the 1.25% nominal gap suggests.
Related: interest-rate-differential, carry-trade, uncovered-interest-parity, sterilised-intervention