All they do is a special interaction when you interact with them in certain areas. Just for fun.
In addition to that, there are various Pokémon that have special interactions, with some boosting happiness, depending upon where you are and if it is the right type or species of Pokémon. Many of these interactions you can be notified of by Lyra/Ethan when you call them in the specific area, but there are a fair few that even they do not know of. Below is a table of the Pokémon, the interactions and the locations for many of them. Some interactions may seem to be repeat