Card sorting is something that I have limited experience with as compared to Affinity Diagram. Basis my experience the similarity with the two would be is that both as a method to sort information gained from different sources. Where they start to be different is from the information of their sources. Usually Affinity Diagram is used when you start organizing the output from brainstorming or ideation sessions conducted from a group or groups that has the intention of providing possible solutions to a predetermined problem or goal of any topic. On the other hand, card sorting is a method that sorts information that would but with the intention of categorizing and identifying patterns specific to technology - it's content, information and design. It is specific to a user interface and user experience.
There are three different types of Card Sorting - open, closed and hybrid. In the Open Card sorting, this is where participants will categorize the information provided to them based on how they understand it. For the Closed Card sorting, categorized are predetermined. Hybrid Card sorting starts out with predetermined categories but at anytime a new category needs to be created then it is added.
So far the type of Card Sorting that I have used would be the Closed Card sorting and Hybrid. We typically use it before we design the product for development or after we have deployed a tool. In both cases we want to get feedback on how the information and design would be best received by end users.