How did hearse (herse) in Enlish, go from a portcullis to a canopy over a bier or coffin to a hearse/car that transports the coffin and body to it's grave ?

Hearse is also used in the Church to describe a stand which holds several candles.