Critics of these passages apparently haven't read the verses fully. In II Samuel 6:23, the passage says that because of Michal's disrespect for the Lord's anointed king, David, that she "had no child unto the day of her death". When we look at II Samuel 21:8, we see spoken of "the five sons of Michal the daughter of Saul...." However, in their efforts to invent a "contradiction" in the Bible, the critics leave out the latter part of verse 8 which follows immediately after, "....whom she brought up for Adriel the son of Barzillai the Meholathite." Adriel is mentioned elsewhere, in I Samuel 18:19, and he is the brother-in-law of Michal, having married Michal's sister, Merab. The five sons mentioned in 21:8 are specifically said to have been raised by Michal, but belonged to Adriel, i.e. for whatever reason, Michal had at some point adopted them as her own sons, perhaps because of the deaths of both Adriel and Merab.
The phenomenon of adoption and the recognition of an adopted child as one's own son or daughter is not an uncommon occurrence in the Bible. Moses was adopted as the grandson of Pharoah and son of Pharoah's daughter (Exodus 2:10), Esther was brought up by her cousin Mordecai as his own daughter (Esther 2:7), and though the term is not specifically used, Eliezer of Damascus, the servant of Abraham, was considered to be the heir of Abraham before the birth of Isaac (Genesis 15:2-4), and hence occupied the place of a son at that time.
At any rate, it is specious to consider this to be a contradiction in the Biblical testimony, since the Bible clearly indicates that the five sons of Michal were hers by adoption ("whom she brought up for Adriel...."), and not by birth, and hence, there is no contradiction with II Samuel 6:23.