Important theological issues were agreed upon at early ecumenical councils, these essentially defined what it meant to be a Christian. After being voted a council, they became orthodox, and alternatives were formally considered heresy. Things like Trinity, dual nature of Jesus, baptism, etc we’re all agreed upon by early councils
The first ecumenical council that formally gave a list of canonical books of the Bible was the Council of Trent in the 16th century. (There was tradition, and smaller decisions in the ancient cities of Rome and Carthage, but no formal ecumenical council decree)
Incidentally, that council also rejected Protestantism (and Luther for demoting many previously canonical books). Since the council rejected Protestants, they rejected the council, and voila, here we are.