DPP-4 inhibitors function by inhibiting the action of the DPP-4 enzyme, thereby prolonging the effects of incretin hormones such as GLP-1 and GIP. These hormones are crucial for regulating blood sugar levels. By extending their activity, DPP-4 inhibitors enhance the body's ability to manage postprandial glucose spikes.