There are several reasons for sparks, depending on the voltage and current:
Low voltage high current (e.g., shorting an automotive battery)
If two conductors capable of carrying a high current touch, there is a high current flowing in a very small cross section (area) of wire, which heats the metal (usually copper) in the vicinity of where the short occurred. A hot plasma can form. The spark is very bright and often has very small and hot specks of copper that shoot away from the point of contact. Examination of the point of contact will show that some copper has melted.
High voltage, low current
Dry air will ionize and spark if the electric field between conductors is greater than about 3 million volts per meter, or 3,000 volts per mm. This is the breakdown potential of air as an insulating dielectric. The sparks are usually thin and range from yellow to blue in color. They can be very long; a spark from an automobile spark plug ignition coil can be over 2 cm long. Sparks from Tesla coils can exceed 10 or 20 cm.
Low voltage DC current with inductance
If there is a current flowing in a dc circuit that has a series inductance L, as soon as the current is interrupted, the voltage across the opening switch will suddenly increase (V = L dI/dt), producing a spark that will persist as the switch opens.