2x=1 comes from the "e" portion of the ICE table - specifically referring to the product that formed (2NH3).
Original Equation is N2 + 3H2 <--> 2NH3
Once you set up your ICE table, you should end up with:
"4-x" under "N2"
"4-3x" under "3H2"
"+2x" under "2NH3"
When we say 2x = 1, we are referring to the last bit of information that was given in the question: "2 moles of NH3 are formed". Since we are in a 2 liter flask, this means that we can simply divide our 2 moles of NH3 by the volume: 2 mol NH3 / 2 L = 1M NH3
Remember that we are almost always talking about molar concentrations in our ICE tables. Now, just put our 2 bits of information together to help us figure out what the "x" value is in our ICE table. Since our ICE table tells us that we will end up with "+2x" molar of NH3, and we used our given to figure out that there is 1M NH3 formed in the end, we just set 2X = 1M (since they are the same thing).
x = 0.5
Now, use this value to plug in for the other expressions in your ICE table. All simply plug/chug algebra from there. Let me know if that was clear.
---------------
As for the Ksp question you had, I think you might have a bit of a confusion between Keq expressions vs. Ksp expressions (something I'm not super awesome at either, but I can usually get by using some little tips). Whenever I see Ksp in the problem/question, I immediately think ICE tables. I think mostly what I've come across for Ksp has involved ICE tables. Also, Ksp just involves the products (hence, solubility product constant) - and the reason for this is important to understand because you won't ever ask yourself again if you should "include reactants on the bottom, too" in your Ksp expression. That is something that I used to have trouble on. Anyways, Ksp for our purposes is used for compounds that are insoluble. Hence, when we write the Ksp expression, we should keep in mind that the compound we are writing the reaction for is insoluble. However, everything is a little soluble. This is why we set up the equation in the first place to show that a little bit of the "insoluble" compound can actually dissociate. In addition to this, I also keep in mind an "exception" for Ksp in terms of setting up the ICE table - it is to pretty much always set up the ice table so that I end up "doubling twice," for lack of better wording. I'm talking about the whole Ksp = [x]^a*[y]^z. And how we usually have the problem set up in such a way that you have to do Ksp = (2x)^2*(x) = 4x^3. To be honest, I always forget the legitimate explanation behind why we have to pretty much do (2x)^2 for a lot of the Ksp problems. Whenever I come across the explanation, it makes sense and all but for some reason, I always forget it lol. Hopefully, you get what I'm referring to, though. And hopefully, I helped answer a bit of your question? My thoughts on Ksp are pretty cluttered and it's not a strong suit of mine so I can't really help explain it in other terms. Someone else, please explain with better wording, if possible haha. I may have confused you more from this, so definitely ignore it if it didn't help. No hard feelings from me lol