RAG vs Fine-Tuning for LLMs: A Comprehensive Guide