The primary mechanism of action for digitalis is the inhibition of the sodium-potassium ATPase pump in cardiac cells. This leads to an increase in intracellular sodium, which subsequently promotes an increase in intracellular calcium via the sodium-calcium exchanger. The increased calcium availability enhances cardiac contractility, which can be beneficial in conditions like congestive heart failure and atrial fibrillation. However, this mechanism can also lead to toxic effects if not properly monitored.