Part of the mechanism is that potassium lowers your blood pressure, whereas sodium raises it.
High blood pressure slowly damages the cardiac walls, leading to less blood flow, which impairs kidney function, which leads to less effective filtration of sodium and potassium, leading to higher blood pressure. So in this way, heart failure becomes self-reinforcing.
One way to break that feedback loop is to start a high-potassium diet.