Does software have errors? Does a vulnerability ruin your day? No problem: if the developer does their job, soon there will be a patch to fix all these issues and more. Now, why do we call them patches? Nowadays, rewriting lines of code and replacing files has nothing to do with covering holes, but back in the punched-card era, programmers did exactly that.
No developer wants to see errors in their programs. Fixing them takes time, money, and physical and mental effort that the end user doesn't always appreciate. Another serious problem is the subtlety of certain bugs. A '0' instead of a '1', a comma in the wrong place... the historical case of the USS Yorktown comes to mind, after being neutralized by a division by zero. Some bugs have cost billions of dollars, so releasing a patch at the right moment is not just good practice, but essential.
'Patch'... if anyone expects a complex or sophisticated origin for the term, I'm afraid they'll be disappointed. When the computing world was ruled by punched cards and tapes, the main methods to correct software errors were two: cutting the affected area with scissors and pasting a new piece with the correct perforations, or in the case of minor bugs, placing a piece of adhesive tape over the hole in question, and creating a new one. At the same time, this also served as general maintenance, for the simple reason that sometimes the tapes didn't have errors but broke during handling or rewinding. Their resistance improved greatly once Mylar tapes hit the market.
Of course, patches took on another profile with the advance of magnetic storage, which also changed the distribution process. Manual and direct corrections on tapes gave way to soft patches that could be sent by mail, or even transmitted with the help of modems. Ideally, in the future the need for patches will disappear. Until that happens, we'll keep fighting.