Ultimately God is behind every event.
However God is invisible, regularly he does not acts by visible interactions.
As for Bishops, the very first ones were appointed by the Apostles, later they were chosen by the people. Like in any democracy this deteriorated to the ‘best bishops money/power can buy’; so beginning the second millennium (investiture controversy, St Gregory VII) the jurisdiction of the bishop (installation) was given directly by the Pope. Some kings, called as Apostolic kings, like the KIng of France and Hungary claimed the right to nomination, but still the bishops get their power/jurisdiction from the Pope.
We do not know how the first popes were nominated, but quite early the nomination was given to the consolatory body around the pope, the college of Cardinals (there is such body around the bishops too, but as far as I know, they never had nominating and installing rights)