Collaborative filtering is a technique used in recommender systems to predict a user's preferences based on other similar users' preferences. It involves collecting ratings or preference data from users, calculating similarities between users or items, and generating predictions for a user's unknown ratings based on weighted averages of the ratings from similar users or items. There are two main types: user-based which computes similarities between users, and item-based which computes similarities between items. Challenges include cold start problems, sparsity of data, scalability issues for large datasets, and reducing user bias.