The N+1 problem occurs when fetching a list of N items triggers N additional queries for a related field — one per item. DataLoader solves it by collecting all keys requested in a single event loop tick and firing a single batch function with all of them, reducing N+1 database queries to just 2.
When a client queries users { posts { title } }, GraphQL calls the posts field resolver once per user. Without DataLoader this means one query per user for their posts. DataLoader queues each userId as field resolvers are called within the same event loop tick, then fires a single batch query with all user IDs collected in that tick.