The concept of the command design pattern is, as mentioned in the introduction, to enable objects to store methods.
This is done by taking the object of the desired method, aka. the invoker and inserting it into a command class. The command class can then execute the desired method of the inserted object at any time.
The thing to note is that each command class implements the command interface, which only declares one method, the execute method.
The command class, which implements the interface, is only intended to call one specific method of the inserted object within the execute. This means that for each method that we want to call, an individual command class must be created. For this reason, you will often see the command class take the name of the method that they are calling. (e.g. BorrowCommand)
This pattern gives us several advantages. Firstly, we can move methods around the system, and call them whenever needed.
Secondly, this also means that we get the result of the method call with the current state of the system and not with the state in which it was when we stored the method.
Finally, we are also able to swap between the commands, since they all implement the same command interface. We can therefore rely on them to have the execute method.