This contradiction deserves a caveat: Chileab and Daniel (as a son of King David) are technically the same person. They have two different names. There is no reason for us to think that Chileab and Daniel are two different people. I am not claiming that this is a contradiction in that sense. But it’s still a contradiction in the broader sense of the word.
1 Chronicles 3 lays out for us the issue of David’s love making in Hebron in order of birth, showing that Daniel is clearly the second-born. You might remember Daniel because, following the death of Annon, his seat on the throne was stolen from him by Solomon, the much, much younger 10th son of David.
2 Samuel 3:2-5, on the other hand, changes Daniel’s name to Chileab, for reasons that are never explained. Indeed, the name Chileab is never mentioned in the bible again. There is also no reason for us to believe that Chileab is a second or variant name for Daniel. The bible doesn’t say, “Chileab, also called Daniel…” It offers no explanation for the name change.
As we could expect, it’s likely that Daniel’s name was changed throughout many years of the game of telephone. Daniel is not an important bible character, so there was little reason to protect his name (or maybe his name was originally Chileab? Eh, doesn’t matter either way). But dumbfoundedly, when the Old Testament was compiled no one bothered to cross-reference these lists of David’s sons.
It’s almost like early bible compilers didn’t care whether or not one list contradicted the other.