代理 and 代表: substituting for a person and representing a group
Compare attending or receiving a package in a person's place with representing a class or town. Identify the individual being substituted for and the group being represented.
Acting in a particular person's place
代理 (だいり) means a proxy or substitute. 「課長の代理で私が会議に出席した。」 reports the speaker attending a meeting in the section chief's place. The chief is the person being substituted for, and the speaker is the attendee.
「祖父の代理として父が荷物を受け取った。」 describes the father receiving a package on the grandfather's behalf. It identifies their relationship without specifying the duration of the substitution.
Representing a class or town
代表 (だいひょう) means a representative or representation. 「各クラスから一人ずつ代表を選んだ。」 reports choosing one representative from each class. Each person's group is a class; the selection method is not supplied.
「彼女は町を代表して全国大会に出場する。」 describes her representing the town in a national competition. The group and the competition are identified without a competition result.
The person replaced and the group represented
In the 代理 examples, a particular chief or grandfather is substituted for. In the 代表 examples, a class or town is represented. Read these two relationships to distinguish the emphasis.
One person can act in an individual's place while also representing a group. The words do not define mutually exclusive types of people, and these examples do not establish legal powers for either role.
What relationships differ between attending as the chief's 代理 and acting as a class's 代表?
Show the answer and why
The first substitutes for a particular person, the chief; the second represents the class as a group. The substituted individual and represented group differ, although one person can have both relationships.

