Commands have an attribute called ConfirmImpact. By default, any command with a ConfirmImpact of ‘High’ will prompt you unless you explicitly tell PowerShell not to (such as with -Confirm:$false).
Just to be 100% accurate you’re getting prompted for a confirmation not a whatif. -Whatif parameter just produces a statement saying it would do something not a prompt to confirm an action