A single chamber pacemaker stimulates either the right atrium or the right ventricle, depending on the patient's condition, while a dual chamber pacemaker stimulates both chambers, ensuring better coordination of heart contractions.