Pants is short for pantaloons, and the item only became a single garment late in its history.
Up until the seventeenth century, the legs were covered with two separate sleeves of fabric called “hose,” which were tied to a belt with braces.
The open crotch was covered with breeches and a long tunic.
The plural reference to a single unit as a “pair of pants” is extended to trousers, slacks, and shorts.
Pantaloons came from the comic wardrobe of a stock character in the Commedia dell’Arte.