The Text field is populated from the transactions being posted, which may initialize it in different ways.
For example, CustVendVoucher.post() uses findDefaultTextForPayment() to initialize the text if none is provided. The value is then passes to LedgerVoucher* objects for the actual posting.
I would try to stay away from implementation details if possible, but if you're interested in them, you surely can explored the code. The value of CustVendTrans.Txt gets passed to LedgerVoucherTransObject instance, which is then used by LedgerVoucherObject and other classes. LedgerPostingTransactionTmp.updateTrans() creates a LedgerPostingTransactionTmp record and stores in a collection. LedgerVoucherObject.post() then processes the records and calls LedgerVoucherObject.post() for each of them. LedgerVoucherObject.post() calls LedgerVoucherTransObject.post(), which calls addToGeneralJournal() (or addToSubledgerJournal()). There you'll find a call of LedgerVoucherObject.addToGeneralJournal(), which calls LedgerVoucher.addToGeneralJournalEntry(), which utilizes LedgerPostingGeneralJournalController class. And the last class is where the data gets actually inserted to database. It doesn't call insert() directly; it uses a record lists for performance reasons. At least, that's my understand after looking statically at the code.
Obviously, if you want to use a different text, you shouldn't change the how the posting works. You should provide a different text already when calling the posting.