In general, tracking codes are used to track campaigns. On the other hand, marketing channels/details are used to track all channels.
There are multiple reasons the values would not match.
Tracking codes are only overwritten by other campaign traffic. For example, if a new visitor arrived via Email today, the last touch channel would be email. The last touch detail and tracking code would both reflect the same tracking code. Tomorrow, the visitor arrives via Organic Search. The last touch channel and detail are updated based on the Organic Search, but the tracking code isn't overwritten. (First touch channel/detail would remain based on email.)
In addition, both dimensions can be set to different persistence. Marketing channel is also a rolling engagement window. This means as long as the visitor is seen within the engagement window, channels will persist. Tracking code, on the other hand, is set based on a certain number of days (not rolling). It will expire after that period, or when replaced by another tracking code.