Here is how I believe the doctrine of the Trinity developed. While this is somewhat speculative, it is an attempt to be as objective as possible with this highly sensitive topic, but I am not a historian nor a theologian. The concept of God as a "being" rather than an individual person (the Father) stems largely from Neoplatonism. Neoplatonist philosophers, who enjoyed applying Plato’s philosophy in new ways, sought to apply it to the nature of God. Using Plato’s Theory of Forms, they derived the idea of God as a "being" in its own right, separate from the Father and the Son. Plato’s Theory of Forms taught that everything that exists also has an ideal form that is purer and more perfect than the physical manifestation. For example, two elephants are imperfect examples of the pure form of an elephant. Neoplatonists applied this method to the newly revealed Father and Son, suggesting that both were imperfect manifestations of a pure form they called "the being of God." This idea eventually evolved into the doctrine of the Trinity.
However, they had to adapt Plato’s Theory of Forms to align it more closely with scripture, as viewing the Father and Son as imperfect would not sit well with Christians. Their philosophical construct of "homoousios" (meaning "of the same substance") was initially successful but its meaning shifted over time since it was a concept that was, in essence, invented. Originally, it was closely linked to Hebrews 1:3, but over time, its meaning moved beyond simply referring to the essence of God. Eventually, the idea of coequality was introduced, which also gained acceptance.
By the time of the Constantinopolitan Creed in 381 AD, the doctrine had begun to contradict scripture, but it had become so widely accepted that the contradictions mattered less. The term "Trinity" had by then become the accepted way to describe three coequal persons within one God-being, and this understanding of God was widely embraced across Christendom. Disputes about the Trinity later contributed to the split between the Eastern and Western churches. The West adopted the doctrine of the Holy Spirit proceeding from both the Father and the Son, while the East held to a "Monarch" doctrine, which emphasized the Father’s supremacy within the Trinity. This led to two distinct concepts of the Trinity.
Not all churches accepted this doctrine, and those that did not were labeled heretical. Islam, of course, developed along a separate path and rejected the Trinity altogether. Later, non-Trinitarian churches and groups, such as Unitarians and Binitarians, developed their own doctrines. Trinitarians, however, largely retained the Neoplatonist terminology, though the meaning of key terms, like "being," continued to evolve.
Today, when members of Trinitarian churches recite the creed, saying that the Son is "of one being with the Father," it is likely that few fully understand what this means. Neoplatonism has faded, yet the creeds remain largely unchanged, even though they are not well understood. Few people, perhaps, realize that there may be contradictions with scripture — apart from those within non-Trinitarian circles.