Action methods can be called from page markup by using {! } notation in the action parameter of one of the following tags: <apex:commandButton> creates a button that calls an action. <apex:commandLink> creates a link that calls an action.
When we click on the “click” button it will invoke pageReference show() method. pageReference is the return type of array method that we have called from visualforce page. So Whenever you want to redirect from one page to another page or want to change some values by calling methods from the apex controller class.