How can potassium disappear after cooking?
As Eric has mentioned in his answer, the potassium present in foods will leach out into water when you cook them. 

Potassium is present in food in the form of potassium ions $(\ce{K+})$. These $\ce{K+}$ ions happen to be extremely soluble in water. 

When food is boiled, the cells break down and release their contents more easily which makes the $\ce{K+}$ ions free to move into the water. The $\ce{K+}$ ions remain in the water since they are so highly soluble in it.

This happens to all water-soluble nutrients like the B vitamins, vitamin C, sodium, etc. Some ways to avoid the loss of all these nutrients would be to steam such foods instead of boiling them since the food wouldn’t come into contact with water.

Side note: The same problem occurs when you deep fry foods containing fat-soluble nutrients like vitamins A and E. These leach out easily into oil and so all those nutrients would also be lost in the process.