Email threads are Pipedrive mail's way of showing you a conversation history of a particular topic with particular participants.
If you have email integration enabled with Pipedrive's Gold plan, the emails you send and receive will be automatically put in to threads within the Pipedrive email app.
Firstly, it's worth noting that this doesn't affect the email in your actual email client such as Gmail or Outlook. Email clients have their own way of threading emails, so within that client, your emails will stay the same as they always have.
Also, threads in Pipedrive are only there for your convenience and do not mean that emails are shared with recipients - unless an email is addressed to someone, they will not receive a copy, even if they are included in the thread.
The automatic behaviour for creating email threads in Pipedrive is that if the system detects an email with a matching subject line and two or more matching participants (including the sender in most cases) will be joined together in Pipedrive, and thus can only be linked to one deal.
Once an email is linked to a thread, it currently can't be unlinked. If you'd like to keep your emails separate and thereby linked to separate deals, simply use different subjects to avoid confusion.