Modern-day organizations came from the desire of local churches to regulate the ministry and receive recognition from the secular government, as well as to concentrate missionary efforts. Most organizations were formed with the assurance that congregational independence would be respected. In the early apostolic churches home missions pastors were ordained by the apostles and their subordinates, but the principle of congregational approval is also seen. So there is precedent for the election of pastors by the congregation. Obviously, these elders serve some function.
Pastor are elders, the elder of the church that they oversee.
Not all elders are pastors, since the term encompasses the senior saint.