Why is my Pokémon getting buffs?

I have elvolved my Munchlax into a Snorlax. I know that you need max friendship level to evolve him.

Once in a while, during battle with him, he will do certain actions like dodge an attack, and it seems like certain moves have better critical hit rates. When ever this happens hearts come out of him which leads me to believe it's because of the friendship level. What is the cause of these effects during the battle?

I've looked through the wiki page on friendship, but the only thing about moves mentioned is

...the power of Return and Frustration...

There seems to be nothing mentioned abut generation VII at all.


Friendship is still present in 7th gen, you need that to evolve Munchlax to Snorlax, as you have experienced.

Pokemon Refresh, instead, affects Affection, which has nothing to do with friendship.

EDIT:

Regarding Affection benefits, you get different send-in, waiting and switch-out dialogues and Pokemon in-battle animations.

The Affection benefits in Pokémon Refresh remain largely the same as in Pokémon-Amie:

A Pokémon with high levels of Affection will gain certain bonuses in battle and will interact with its Trainer in unique ways.

  • At Affection level 2 and higher, a Pokémon will gain 1.2 times the normal experience from battles.

  • At Affection level 3 and higher, a Pokémon may endure attacks that could otherwise make it faint and survive with 1 HP (including confusion damage). This can activate multiple times per turn.

  • At Affection level 4 and higher, a Pokémon can sometimes:

    • Avoid attacks, even when they have 100% accuracy. This can activate multiple times per turn.
    • Shake off status conditions at the end of the turn.
  • At Affection level 5 and higher, a Pokémon can sometimes have higher chance of critical hits.

An Affection level of 2 or higher is also a prerequisite to evolve Eevee into Sylveon. (The other requirement is that Eevee must know a Fairy-type move when it levels up).

There are some cases where Pokémon do not get their Affection bonuses, however. More broadly, battles conducted over wireless or online play, do not incorporate any Affection benefits.

Also, here's a summary table:

enter image description here