SAP is one of the softwares so bloated and almighty, that without it large parts of the supply chain and society as a whole would not function. It's fucking huge and can do *everything*. SAP is made by a company called SAP AG. So SAP refers to both the company and the software. The software can be categorized as Enterprise Resource Software. Businesses use it to support their diffent processes. SAP is made out of different modules like accounting, production planning, logistics, sales and so on. The modules can be activated independently and work together (most of the time).
SAP started in the 70's by the people responsible for all the bad things in the world: Germans. The first version of SAP used punchcards and ran on mainframes the size of buildings, all so that you could perform some basic calculator functions.
Then in the 80's release "R/2" came and delivered peak comfy text-UI to your corporate terminal screen. Now there were finance, logistical management and even early production planning applications available. Businesses bought the software together with a service contract.
In the early 90's SAP decided that using TUI interfaces was too old-school and developed an entire graphical framework for their ERP-Software. It's ugly as fuck but very consistent across all applications. This release is called "R/3". The bloat kept increasing with the scope of the software. By this time SAP had a pretty good understanding of different businesses around the world and they developed a "model company". This model company is the basis for customizing SAP to the needs of every existing company around the world. At least thats their claim.
The latest release is S/4 which is supposed to integrate the different modules and work on a cloud architecture. So back to mainframes it is, then.
Why do businesses use it?
Because SAP is more or less modular and because it has standardized template for businesses. If your business processes correlate to those which can be modelled in SAP, you can create a digital representation of your company. This in turn can be used to plan, execute and controll business processes and lower the transaction cost within and between businesses. Should your business processes be different than those from SAP, you are going to have to change your business. Or hire consultants and ABAP developers to write custom programms and bloat your system even more.
Lately, SAP has been trying to get businesses to use it's own cloud plattform. The way it works is basically like this: You buy a licence and get access to a preconfigured SAP system via your web browser. Then you do business things like planning sales, creating invoices and ordering materials for production. This is obviously better for smaller companies who do not host their own SAP system on premise. You also get cool analytical tools and colorful graphs for your smartphone so you can look at numbers and pretend to know what is going on inside your company.