At its root, to impeach someone is to shackle them by the feet.
Etymonline traces the word to Late Latin impedicare, "to fetter, catch, entangle." Its core is pedica, a shackle or fetter, which comes from pes, "foot." In Old French this became empeechier, recorded from the 1100s, meaning "to hinder, stop" and also "to trap, ensnare."
English took it in the late 1300s as empechen, "to impede, hinder, prevent." In the early 1400s it could even describe running a ship aground. The legal sense grew alongside. By the late 1300s it could mean simply "to accuse." By the mid-1400s it was used for a formal charge of treason or high crime, brought by the king or the House of Commons.
Why would "hinder" turn into "accuse"? Etymonline suggests a mix-up in Medieval Latin with a different verb, impetere, "to attack, accuse." Middle English also had apechen, "to accuse," which Etymonline thinks probably came from a variant of the same French source. Its descendant appeach is now obsolete.
The procedure itself is older than most readers expect. In 1376 the English Parliament later called the Good Parliament met from late April into July. Its members believed that men close to Edward III were robbing the treasury.
The Commons drew up charges against courtiers and financiers, including William, Lord Latimer, the king's chamberlain, and Richard Lyons, a wealthy London merchant. The Lords sat as the court. The History of Parliament describes this as a procedural novelty, and Wikipedia calls Latimer's case the earliest recorded impeachment in Parliament. The same session produced the first recorded Speaker of the Commons, Sir Peter de la Mare.
The victory did not last. After the session, John of Gaunt recalled Latimer and had de la Mare imprisoned. In 1377 a new Parliament declared the Good Parliament's acts void.
The procedure survived anyway. The History of Parliament says impeachment was rare after the Middle Ages, and its last British use came in the 19th century. The word has outlasted the British practice, and today it is heard far more often about presidents than about chamberlains.