Explanation & Logic:
The logic uses the sum of the alphabetical positions of each letter ($A=1, B=2, C=3, \dots, Z=26$).
For CAT: $3 + 1 + 20 = 24$.
For BAT: $2 + 1 + 20 = 23$.
Following the same pattern for RAT: $R=18, A=1, T=20$, so $18 + 1 + 20 = 41$.