The JSON-RPC API can be used by other programs to communicate with the Bitcoin client. That could include external mining programs, "e-commerce" software to automatically make and receive payments, or any other software that wants to interact with the Bitcoin network.
It is true that you do not need this feature simply to solo mine using
setgenerate true. However, you should be aware that
setgenerate true enables an inefficient CPU miner which is obsolete technology and should be used for testing only. It will cost you far more in electricity than you can ever expect to earn in mining revenue, and with very high probability you will never successfully mine a single block. The current state of the art in mining is dedicated ASIC hardware. Such hardware would normally be controlled by a separate piece of software, which would then communicate with the Bitcoin client over the RPC API.