If you mean the onboarding flow example. The cognitive dissonance is at minimum there.
The idea is that usually people subscribe or register for free services when they are promoted. In that case, sometimes the user can have mixed feeling in regards to the product/service. So it is good to give the user a bit of space so he could deal with the cognitive dissonance on his own. Before you want to sell him the paid product.
The second example is much more clear case because there the intent is to design a solution that provides “a way out” of the cognitive dissonance. As in the popup modal.
Hope this clears it a bit.