There are more than 300 biochemical reactions that require magnesium. Also, chlorophyll (the chemical plants use to trap light for photosynthesis) contains magnesium. Potassium is used in the activation of some enzymes as well as being the "plant preferred" ion for maintaining the osmotic potential of plant cells: in other words it is used in a biophysical role to maintain the turgor or rigidity of the cells.