There are many contradictory theories about the origin of the term "bullpen" in baseball. The most prevalent theory claims that the term arose because Bull Durham tobacco placed ads in every ballpark in the nation in 1910 and pitchers used the shade of the Bull Durham signs to warm up. However, the term "bullpen" has been used to describe a holding area, often with negative connotations, since the 19th century.
Another popular theory connects the term to an actual bullpen that existed at the Polo Grounds in New York in the late 1800s. Pitchers would use an area near the bullpen to warm up, and so the name stuck. Others claim that the area was originally a place to put fans who bought cheap tickets and that they were herded into the spot like cattle. The famous outfielder Casey Stengel always said the term came from the fact that pitchers would sit there "shooting the bull."
One of the most likely interpretations simply comes from the cattle industry. Before animals could be brought in to slaughter, they had to be corralled and controlled. This usually occurred in a small holding area where they could be brought out one by one to the slaughter. The term was used to describe the infamously brutal Andersonville prison camp during the Civil War, and it's possible the term came to represent an area where relief pitchers would wait before facing their own "executioners" as well.