Why does Spain have ‘enclaves’ in North Africa?

Wait 5 sec.

The Spanish enclaves lie on the northern coast of Africa, bordering Morocco.