Remember defibrillators defibrillate a heart - i.e. they help to restore normal rhythm when there is a serious rhythm disturbance (these often accompany "heart attacks").
Defibrillators, however, are not effective for dealing with situations where heart activity has completely stopped (asystole). Although they are always used for this in the movies.
So they are not helpful in all cardiac emergencies.
The defibrillators installed on aircraft and in other public places are automated - they actually diagnose the problem and decide whether to administer a shock. So the electrodes are attached for all cardiac emergencies - and the unit decides whether it's the sort of problem where a shock would help.