A teaming agreement is a contract between two businesses, not with the government, laying out that one will bid as prime and the other as sub, along with rough workshare and terms, if they win together. It does not create a new company the way a joint venture can, and it is usually tied to one specific pursuit or a defined set of them, not an open-ended partnership. Because it is a real contract between the two of you, it is worth having it reviewed rather than working off a handshake, especially around what happens if you lose, or if one side wants out.
In a sentence
"The parties agree to team on this solicitation, with Company A as prime and Company B as subcontractor for the tasks described in Attachment A." That workshare split is a private business agreement, not something the government enforces for you, so get the terms in writing before you rely on them.