This article explains how to group messages in Thunderbird based on a parameter of your choice.
Here's how to organize your emails more efficiently in Mozilla Thunderbird by organizing them into groups based on your sort order. For example, if you choose to sort your emails by date, grouping them into groups will divide them by date.
Open the folder containing the messages you want to sort into groups.
Go to View > Sort By and select the parameter you want to sort your emails by. In this example, we choose to sort by whether the emails have attachments.