How Agentic AI Works: AI Agents, Autonomous Systems, and Multi-Step Reasoning