Router advertisement messages are used in IPv6 networks to advertise routing information, including network prefixes, to hosts. When SLAAC is used, routers send router advertisement messages periodically, informing hosts about the network's prefix, which the hosts then use to generate their IPv6 addresses. This process allows hosts to configure their own IPv6 addresses without the need for a DHCPv6 server.