Horsepower is the amount of work done over time by engines or by actual ponies. Car manufacturers need a convenient way to be able to measure the performance of their engines. Using the term horsepower also conveys the performance of the car in a more visual way. If you have a 300 HP engine, you can almost imagine 300 horses pulling your car forward. That's definitely a lot of horses for one small car!
An engineer named James Watt invented horsepower to sell his brand new steam engines back during the times when everything was horse-drawn.