Maintenance is a well-known concept, the general idea is to prevent things to stop doing what is supposed to do; this can be applied to everything, for example, we usually have the car to have maintenance so we can prevent future problems that will be more expensive than the maintenance.
In software there is no difference, every program needs maintenance to prevent future problems, even if software is not a physical thing, is also a product that has a functionality, and because of that, is vulnerable to suffer malfunction with the time.
Software maintenance is defined as the process of modifying a software system or component after delivery to correct faults, improve performance or other attributes, or adapt to a changed environment.
As the previous quote suggest, maintenance corrects faults, improve performance, adapt and prevents problems; this means that there four types of maintenance: the corrective, the adaptive, the perfective and the preventive.
The corrective seeks for malfunctions and problems in the system, then it modifies it to solve problems and bugs; the adaptive applies modification to keep the product up to date to the ever changing world of technology and business environment; the perfective is to improve performance and to keep the software usable over a long period of time, as well as adding more functional requirements and new features; and the preventive aims to attend insignificant problems that may cause serious problems in the future.
Software maintenance is the last step of the software life-cycle; from here you may be wondering why is a cycle? why the gathering is required again? This is because in maintenance you are looking for new problems and new requirements that then, you will have to design, code, test and deploy again leading to maintenance and completing the cycle again, repeating it until the software is no longer needed.