A3: The setState() function triggers the rebuilding of the widget tree, updating the UI with new state values.