On the other hand, suppose that Company A describes the invention in detail (or in more formal terms, provides a disclosure) at a trade show, before a disclosure or a filing by the second company.
Patent law gives inventors the exclusive rights to use or license their inventions, for a fixed period of time, to encourage disclosure and allow them to benefit from and recoup the cost of their invention.