"en" and "y" are pronouns that replace indirect objects, i.e. objects that are introduced by "de" and "à" respectively. The use of "de" or "à" depends on the verb and must be learned together with the verb.
E.g.:
Il se souvient de son enfance. --> Il s'EN souvient.
Il va à Paris. --> Il y va.
Since partitives are introduced in French by article "de" (in English, the noun is used without any articles), "en" is also used to replace direct partitives:
Il a du pain (He's got bread) --> Il en a.
Remark: in the case of "à", if it introduces a person, the corresponding indirect personal pronoun (me, te, lui, nous, vous or leur).