A Relay is an aggregator of data repos from across the Atmosphere. They sync the repos from PDSes and produce a firehose of change events. AppViews use a Relay to fetch user data.
Relays are an optimization and are not strictly necessary. An AppView could communicate directly with PDSes (in fact, this is encouraged if needed). The Relay serves to reduce the number of connections that are needed in the network.
Source: https://atproto.com/guides/glossary#relay