When to use 'set state to value of" versus show & hide groups

Hello, I’m confused as to when I should set menu state of index versus show and hide a group to navigate between groups in the mobile app. Any thoughts are appreciated!