The primary mechanism of action of cardiac glycosides is the inhibition of the sodium-potassium ATPase enzyme. This results in increased intracellular sodium levels, which in turn increases intracellular calcium through the sodium-calcium exchanger. The increased calcium enhances cardiac contractility, making these compounds useful in treating heart conditions. However, this mechanism also underlies their potential toxicity.