Mocking API requests lets tests control responses, avoid network flakiness, and focus on component behavior.