For a very long time, I always thought that Buddhism was totally against caste. In so many references, the Buddha has explicitly said that what you are is defined by your deeds not birth such as sutta nipata verse 136 or majjhima nikaya 2-147ff.
So it was quite surprising that I read in the digha nikaya 3.80 ff about how the caste system came about and how this was the natural order!!!!
Mind you, the epistle does say that it's not what the shudhra or Brahman's birth condition that determines the future post death state or trajectory but the deeds.
Still to read that caste is the natural order is surprising. But then the association is also described based upon what they do. Or deeds. If you make war then you are a Kshatriyas. Period.