The titles of both these works are based on word-plays that build on the similarity between the Hebrew words for "answer" (i.e., responsa) and for "repentance." The titles thus sound like well-known moral terms, respectively: the gates of repentance, and opportunities for repentance.
Sha'arei Teshuvah was composed by Rabbi Hayyim Mordecai Margolies, and Pit-hei Teshuvah by Rabbi Abraham Zvi Hirsch ben Rabbi Jacob Eisenstadt.
Rabbi Margolies lived during the late eighteenth and early nineteenth centuries. Rabbi Eisenstadt lived during the mid-nineteenth century.
Rabbi Margolies lived in Dubno, Poland. Rabbi Eisenstadt served in various communities in Poland and Lithuania.
These two works had identical programmes; namely, to produce a digest of material from the "responsa" literature (the answers sent by distinguished scholars to inquiries on points of Jewish law and Talmudic interpretation) as a supplement to the Shulhan 'Arukh. For all its importance as a record of the practical application of religious law to real-life situations, the material remained difficult to access even by erudite scholars, since it was scattered in hundreds of collections by the individual authorities, often without usable organization or indexes. Furthermore, many important responsa had been composed after the publication of the Shulhan 'Arukh.
Sha'arei Teshuvah covered only the volume 'Orah Hayyim of the Shulhan 'Arukh. Eisenstadt explicitly declared explicitly that his intention was to follow exactly the format of Margolies work, but for the remaining three volumes. For the most part he limited himself to collecting and condensing material from the responsa collections (he cites some 180 different works), though he does sometimes introduce his own interpretations or opinions.