Testing complex systems can be challenging, especially when we are dealing with dependencies. If our software depends on an external system such as a database or another service backend, it's hard to make our test without predicting the results from something that is not in our control. We can use a mechanism to prevent this from affecting us. We can use mocks that will mimic the expected output from another system.
Making our tests repeatable is a must in modern software development. Mocking will allow us to always get the same result, regardless of how many times, or in what order, our tests run.