The founding definition of "horsepower", namely: the amount of work an average horse can do per unit time, specifically the work of lifting, via siphon pumps, water out of flooded mines.
In science, horsepower, aka "horse-power" or pony power, is the amount of work, or weight lifted though a height, that an average horse can do per unit time; standardized as "33,000 foot-pounds per minute" (Watt and Boulton, 1783), which translates to the effect that one average "draft horse", when turning a siphon-like piston and cylinder water pumping device, can raise 33,000 pounds of water by one foot in height in one minute.

Overview
In 1556, Georg Agricola, German mineralogist, in his his De Re Metallica, described a number of pumps, suction, ball and chain, and bucket; one elaborate installation, at Chemnitz, e.g., lifted water 660-feet in three stages with pumps of the ball-and-chain design, that was operated by 96 horses, working four hours and resting twelve, in teams of eight to a pump.

In 1589, in a translation of one of Hero's Spiritalia, the following diagram of a four-cylinder "one-horse" pump was presented, which shows one horse being "worked", per unit time, to turn a set of inter-meshed gears, which turns a crank arm, which work a set of four siphon-like piston and cylinder pumps, which thus work to lift water out of flooded mines, to heights of about 30-feet, as shown, therein illustrating the transformation of rotary motion to reciprocating motion via gears: [11]

In 1615, Salomon de Caus, in his The Reasons for Moving Forces, gave the following illustration of a "four-horse pump" for draining a mines: [6]

In 1702,
Thomas Savery, in regards to his Savery engine, commented the following:

Water, in its fall from any determinate height, has simply a force answerable and equal to the force that raises it. So that an engine which will raise as much water as two horses working together at one time in such a work can do, and for which there must be constantly kept ten or twelve horses for doing the same, then, I say, such an engine will do the work or labor of ten or twelve horses; and whereas this engine may be made large enough to do the work required in employing eight, ten, fifteen, or twenty horses to be constantly maintained and kept for doing such a work, it will be improper to stint or confine its uses and operation in respect of water-mills.”
— Thomas Savery (1702), Miner’s Friend (pg. 26)

In 1734, Marten Triewald, in his Short Description of the Atmospheric Engine, stated that the Newcomen engine, installed at the mines at Dannemore, for pumping out water, was doing as much work as “66 horse-whims, each drawn by 4 pairs of horses, or altogether 528 horses in 24 hours.” [11]

In c.1735, John Desaguliers calculated that the "power of one horse" equals 27,500 foot-pounds. [7]

In 1739, one Newcomen engine installed at a colliery at Fresnes, France, with a 30-inch diameter cylinder and a 9-foot piston stroke, which lifted water at a rate of 15 strokes per minute, from 90-feet below the surface, working 48-hours per week, with little human attendance, replaced a previous system of 50-men and 20-horses, working in shifts throughout the week. [1] This version of the Newcomen engine, accordingly, was a 20 hp engine, roughly speaking.

Smeaton
In c.1765, John Smeaton equated "power of one horse" to be equivalent to 5 men or to 22,916 pounds of water raised one foot high in one minute against the force of gravity. [2]

In 1772, Smeaton conducted a number of experiments on various Newcomen engines of various sizes and improvements, aka Smeaton engines, to compile the following horsepower table: [12]

Bolton & Watt
In 1762, Matthew Bolton, after inheriting a large sum of money upon his father’s death, opened the “Soho works” manufacturing plant, which made clocks and timepieces. The mill, at this time, was operated by horses, being that water-power (running rivers) were lacking at Soho. Being that the power of horse was irregular and sometimes failed, he soon began to contemplate the possible application of the steam engine to his mill.

“The enormous expense of the horsepower put me upon thinking of turning the mill by fire.”
— Matthew Bolton (1766), “Letter to Friend”

He continued that he had been recently making fruitless experiments on the subject. On Feb 22, 1766, Boulton wrote Benjamin Franklin about this and sent him a model he had made. [4] Soon thereafter, English inventor John Roebuck, a correspondent of Boulton’s, told him of a young Scottish inventor named James Watt who had been making recent progress with model steam engines. Boulton then invited Watt to visit him at Soho, which he did on a return from a visit to London.

In 1775, Boulton and Watt formally entered into partnership, and it was mainly through the energy and self-sacrifice of Boulton, who devoted all the capital he had or could borrow to the enterprise, that the steam engine was at length made a commercial success; and for the next eleven years the Soho Foundry they made Watt's steam-engines for colliery owners to pump water out of mines, the Boulton & Watt engine being four times more powerful than Thomas Newcomen's original design.

In 1782, James Watt found, via experiment, that a “brewery horse” was able to produce 32,400 foot-pounds per minute.

In 1783, Watt and Matthew Boulton, working together, standardized the figure of one “horsepower” at 33,000 foot-pounds per minute, in order to classify their engines for sale, and by 1809, this was generally accepted as equivalent of 1 horsepower, as it is today. This meaning that this was the amount of mechanical effect that the average “brewery horse” could produce in one minute (see: mechanical equivalent of heat). In other words, through experiment, it was determined that one horse, on average, could work a rotational device, such to turn gears, resulting in the lifting of 33,000 pounds of water out of a mine in one minute. [1]

Units
The following are the related SI units:

Newton (unit) | Force | kg⋅m/s²
Joule (unit) | Energy | N⋅m | kg⋅m²/s²
● Watt (unit) | Power | J/s | kg⋅m²/s³

In modern units, one horsepower (hp), equaling 33,000 foot-pounds
(ft⋅lb) force per minute, equates to 550 foot-pounds force per second of mechanical action, which, knowing that ft⋅lb = 1.356 J, equates to 745.7 joules of energy per second, or 745.7 watts.

In 1912, the horsepower was standardized as follows:

“There was, before 1911, no precise definition of the horsepower that was generally accepted and authoritative, and different equivalents of this unit in watts are given by various reference books. It is obviously desirable that the horsepower represent the same rate of work at all places. The value most used in electrical practice has been the round number, 746 watts, and in 1911 the American Institute of Electrical Engineers adopted this as the exact value of the horsepower. Thus defined, it is the rate of work expressed by 550 foot-pounds per second at 500 latitude and sea level, approximately the location of London, where the original experiments were made by James Watt to determine its value. The number of foot-pounds per second in a horsepower accordingly varies with the latitude and altitude. This value, 746 watts, will be used in future publications by this Bureau as the exact equivalent of the ‘English and American horsepower’. The horsepower tables in this Bureau's Tables of Equivalents formerly assumed 550 foot-pounds per second as the correct equivalent at 45° latitude, because of the well-established use of 45° as a standard latitude. This gave the inconvenient relation, 1 horsepower = 745.6494 watts.”
— Samuel Stratton (1912), The Relation of the Horsepower to the Kilowatt [10]

Quotes
The following are related quotes:

“Savery was the first who suggested the method of ex-pressing the power of an engine with reference to that of horses. In this comparison, however, he supposed each horse to work but eight hours a day, while the engine works for twenty-four hours. This method of expressing the power of steam engines will be explained hereafter.”
— Dionysius Lardner (1840), The Steam Engine Explained (pg. 61)

Horse-power is the name given to the unit in terms of which engineers measure the power of steam engines, water-wheels, and other prime movers. It is defined to be the rate at which an engine works when it does 33,000 foot-pounds of work per minute, a foot-pound being the amount of work necessary to raise a pound weight a foot high. We must go back to the early history of the steam-engine to discover the reason why this number was adopted. The first steam-engines were employed to drive mills, pumps, and other machinery which had previously been driven by horses; and it seemed natural to express their working-power in terms of the number of horses whose work they were got to accomplish. This led to experiments being made in order to get an estimate of the average working-power of a horse. Several such estimates have been given, all differing considerably from each other; but the one adopted whereby to express horse-power is that obtained by Boulton and Watt from observations on the strong dray horses employed at the London breweries working eight hours a day. They found that a horse was able to go at the rate of 2.3 miles per hour and at the same time raise a weight of 150 lb by means of a rope led over a pulley. This is easily seen to be equivalent to 33,000 lb raised one foot per minute, and hence the number given above.”
— Anon (1890), “Horse-power” in Encyclopedia Britannica, Volume 12 (pg. 207)

Manpower
Waterpower

References
1. Kirby, Richard S., Withington, Sidney, Darling, Arthur B., and Kilgour, Frederick, G. (1956). Engineering in History (pgs. 154, 171-72; Fresnes, pg. 165). New York: McGraw-Hill.
2. Biringuccio, Vannoccio. (1540). Pirotechnia of Vannoccio Biringuccio (American Institute of Mining and Metallurgical Engineers, New York, 1942, pg. 22).
3. Andrew, Carnegie. (1905). James Watt (pg. 91). Doubleday.
4. Boulton, Matthew. (1766). "Letter to Benjamin Franklin", Feb 22.
5. Hills, Richard L. (1989). Power from Steam (pg. 89). Cambridge University Press.
6.
(a) Caus, Salomon. (1615). The Reasons for Moving Forces (Les Raisons des forces mouvantes). Publisher.
(b) Kirby, Richard; Withington, Sidney; Darling, Arthur; and Kilgour, Frederick. (1956). Engineering in History (pg. 154). Courier, 1990.
7. (a) Kirby, Richard; Withington, Sidney; Darling, Arthur; and Kilgour, Frederick. (1956). Engineering in History (pg. 171). Courier, 1990.
(b) Hills, Richard L. (1989). Power from Steam (pg. 89). Cambridge University Press.
8. (a) Hero. (1589). Spiritalia. Publisher.
(b) Author. (1920). “Article” (Ѻ), Transactions of the Newcomen Society, Volume 16, Date.
(c) Kirby, Richard; Withington, Sidney; Darling, Arthur; and Kilgour, Frederick. (1956). Engineering in History (pg. 166). Courier, 1990.
9. Savery, Thomas. (1701). The Miner’s Friend: an Engine to Raise Water by Fire. Publisher.
10. Stratton, Samuel W. (1912). The Relation of the Horsepower to the Kilowatt (§II: Historical, pgs. 7). US Government Printing Office.
11. (a) Triewald, Marten. (1734). Short Description of the Atmospheric Engine (pg. 33). Courier Press, 1928.
(b) Kirby, Richard S., Withington, Sidney, Darling, Arthur B., and Kilgour, Frederick, G. (1956). Engineering in History (pgs. 164-65). New York: McGraw-Hill.
12. Farey, John. (1827). A Treatise on the Steam Engine: Historical, Practical, and Descriptive (table, pg. 183). Longman.