RAG systems work by first retrieving relevant documents from a database (like a company's internal wiki or knowledge base) and then feeding those documents to an LLM alongside the user's prompt. This reduces hallucinations and allows the AI to answer questions based on proprietary, up-to-date data rather than just its pre-training data.