The Evolving Faces of "The"
There are four definite articles in Spanish which correspond to the one definite article in English: the. The reason for this is because there are two numbers -- singular and plural -- and two genders, masculine and feminine. The story of how they came to be is not quite a straight line, but it can be told briefly.
Latin had three genders -- the masculine, feminine and the neuter, but the neuter was lost (almost entirely, but not quite), being absorbed into Spanish mostly by the masculine, but sometimes by the feminine (if the neuter plural was more commonly used in Latin, it was absorbed by the feminine, since the neuter plural accusative ends in -a). Just how complex Latin is with respect to its case endings can begin to be appreciated by examining the forms of the articles in Latin.
Spanish derives its primary forms of words inherited from its mother tongue from the accusative, not the nominative. By examining the masculine and feminine accusatives, singular and plural, it is relatively easy to see how the evolution took place. For the masculine singular and plural, we have illum and illos; for the feminine, we have illam and illas. The first step in their evolution involved the loss of weak, final nasals; in the case of the articles, the final -m in the singulars. Next, short syllables were dropped, but in the case of the -u- of the masculine singular accusative, it often passed through an intermediate period during which it was an -o-. Although the initial i- was weak and eventually was often dropped (as happened with the feminine articles), the -u- > -o- in the masculine singular may have helped reinforce the notion of the masculine gender of the noun associated with it -- illo libro (a conjectural medieval construction) which eventually dropped as well, leaving only il > el.
For the feminine, it is easier to see the evolution: illam > illa and a subsequent loss of the weak initial -i leaving la. For the plural, the illas evolved to las simply by the loss of that weak initial vowel.