[verb (plain)] + 次第です [sentence] + という次第です
次第です closes a formal explanation of how you came to do something: "that is why I…", "this is how it came about". It follows a plain-form verb, most often the た-form, since what you are explaining has already happened, and it belongs to business letters, emails, speeches and reports.
The sentence usually starts with the reason – a て-form, a ので clause, ため – and 次第です closes it on the action you took. The action is nearly always your own or your organisation's.
After a sentence that has already laid out what happened, というしだい次第です sums it up.
With a humble verb of saying or asking, the non-past is a set way of offering thanks, an apology or a request.
次第 has other uses – "depending on" after a noun, "as soon as" after a ます-stem. Sentence-final 次第です after a verb is this one.