Well, basically, in Roman numerals you can only subtract I, X or C - 1, 10 or 100 - and only one letter at a time.
XIV initially gives you XI = 11, but then you see V, a larger number than I, so you substract that and get IV=4. Then you get X + IV = 10+4 = 14.