What is a surety?
A surety is a party that provides a guarantee for another party. In the old days, a surety was an individual. This individual would provide their word on behalf of another and, if that other person did something improper, the first party would provide recompense to the party harmed. For example, in the old west, a shopkeeper would the surety for a rancher if they were getting a loan from the bank to purchase some cattle. If the rancher would then default, say by selling those cattle and gambling away the funds, the shopkeeper would pay the banker back all of the funds.
This evolved over time to the corporate arena. That is, it was more than just guaranteeing the "Jim" did what he was supposed to do. Instead, the surety would be guaranteeing the performance of a company. Again, this could be a wealthy person guaranteeing that a company would finish a job timely.
Over more time, this evolved again so that a company became the guaranteeing party, or surety. What would happen is that a large company would guarantee that a smaller company would perform the contract per its terms. For example, a general contractor would provide surety that the subcontractor would perform.
The last evolution of the surety system became when companies became sureties as their main business line. What happened is that insurance companies set up divisions to act as surety on behalf of other companies.