Early on Christians wondered what happened after death. Irenaeus wrote in "Against Heresies", "The preservation of our bodies is confirmed by the resurrection and ascension of Christ: the souls of the saints during the intermediate period are in a state of expectation of that time when they shall receive their perfect and consummated glory." As time went on, various church fathers wrote about this intermediate state. These include Cyprian, Chrysostom and Augustine. The Eastern church, as is our practice, just simply says that after death, those who are counted among the sheep, continue to grow in our relationship with God.
The Western church, however, kept developing doctrines for souls after death and thus purgatory was the answer.