Usually, when braces are first removed, your teeth will all be in perfect alignment, and your smile is excellent. However, your gums, bones, etc will not have completely shifted into their new positions.
The retainer holds your teeth in position until your gums, bones etc settle in to their new positions. At the end of your orthodontic treatment, your smile will be wonderful and your will look excellent. You need to wear your retainer to keep yourself looking excellent. Also, you are still growing after your braces are removed. Sometimes, your mouth will grow unevenly. If so a retainer can be used to make sure your teeth stay perfect as you grow.