Companies don’t really need non-competes anymore. Some companies take an extremely broad interpretation of IP confidentiality, where they consider doing any work in the industry during your lifetime an inevitable confidentiality violation. They argue it would be impossible for you to work elsewhere in this industry during your entire career without violating confidentiality with the technical and business instincts you bring to that domain. It doesn’t require conscious violation on your part (they argue).
So beware and read your employment agreement carefully.
More here https://www.promarket.org/2024/02/08/confidentiality-agreeme...
And this is the insane legal doctrine behind this
You are required to hold confidential stuff for life, like business contracts, but you can use your know-how, if it does not violate any patents, in a competing company as you see fit. This knowledge is a part of you and cannot hold you against employment. Even if you do decide within those two years to employ yourself in competing company, this can be held back by your original company only if they give you X% of your pay at them (X can be 80, or as low as 50, as my friends inform me).