The Apriori algorithm is used to find frequent itemsets and association rules. It works in iterative passes over the transactional database, where it first counts item occurrences to find itemsets that meet a minimum support threshold, and then generates association rules from those frequent itemsets that meet a minimum confidence threshold. The algorithm uses the property that any subset of a frequent itemset must also be frequent. It employs a "join" step to generate candidate itemsets and a "prune" step to remove any candidates where a subset is infrequent, reducing the search space.