Who elects them?
The Pope is elected by the Cardinals.
Episcopal candidates are nominated, and the names sent to Rome. Three names are presented to the Pope. He chooses one.
In the U.S., the bishops insisted on picking their own successors. This process was so obviously corrupt that Archbishop Pio Laghi, the Apostolic Delegate to the U.S. in the 70s and 80s (IIRC) wrote an exposé of the practice. Cardinal Joseph Bernardin was able to fill the U.S. episcopacy with many of his homosexual cronies. Bernardin, fortunately for the Church, has been dead for about 20 years.
JPII is said to have routinely picked the top folder of the three and signed his name. That’s how we got so many wretched, corrupt bishops during his papacy. JPII was also deaf to the cries of the suffering faithful, leaving in place homosexual, heretical bishops in Albany, Pittsburgh, Milwaukee, and many other dioceses.